Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

12345678910111213141516171819202122232425262728293031
  1. // @flow
  2. import UIEvents from '../../../service/UI/UIEvents';
  3. import { MiddlewareRegistry } from '../base/redux';
  4. import { TOGGLE_SHARED_VIDEO } from './actionTypes';
  5. declare var APP: Object;
  6. /**
  7. * Middleware that captures actions related to YouTube video sharing and updates
  8. * components not hooked into redux.
  9. *
  10. * @param {Store} store - The redux store.
  11. * @returns {Function}
  12. */
  13. // eslint-disable-next-line no-unused-vars
  14. MiddlewareRegistry.register(store => next => action => {
  15. if (typeof APP === 'undefined') {
  16. return next(action);
  17. }
  18. switch (action.type) {
  19. case TOGGLE_SHARED_VIDEO:
  20. APP.UI.emitEvent(UIEvents.SHARED_VIDEO_CLICKED);
  21. break;
  22. }
  23. return next(action);
  24. });