You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

middleware.js 636B

123456789101112131415161718192021222324252627
  1. // @flow
  2. import { MiddlewareRegistry } from '../base/redux';
  3. import UIEvents from '../../../service/UI/UIEvents';
  4. import { TOGGLE_RECORDING } from './actionTypes';
  5. declare var APP: Object;
  6. /**
  7. * Implements the middleware of the feature recording.
  8. *
  9. * @param {Store} store - The redux store.
  10. * @returns {Function}
  11. */
  12. // eslint-disable-next-line no-unused-vars
  13. MiddlewareRegistry.register(store => next => action => {
  14. switch (action.type) {
  15. case TOGGLE_RECORDING:
  16. if (typeof APP === 'object') {
  17. APP.UI.emitEvent(UIEvents.TOGGLE_RECORDING);
  18. }
  19. break;
  20. }
  21. return next(action);
  22. });