您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

middleware.js 610B

1234567891011121314151617181920212223242526
  1. // @flow
  2. import { MiddlewareRegistry } from '../base/redux';
  3. import { OPEN_KEYBOARD_SHORTCUTS_DIALOG } from './actionTypes';
  4. declare var APP: Object;
  5. /**
  6. * Implements the middleware of the feature keyboard-shortcuts.
  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 OPEN_KEYBOARD_SHORTCUTS_DIALOG:
  15. if (typeof APP === 'object') {
  16. APP.keyboardshortcut.openDialog();
  17. }
  18. break;
  19. }
  20. return next(action);
  21. });