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 573B

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