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

middleware.js 631B

12345678910111213141516171819202122232425
  1. import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../../app';
  2. import { MiddlewareRegistry } from '../../base/redux';
  3. import { startNetInterception, stopNetInterception } from './functions';
  4. /**
  5. * Middleware which captures app startup and conference actions in order to
  6. * clear the image cache.
  7. *
  8. * @returns {Function}
  9. */
  10. MiddlewareRegistry.register(store => next => action => {
  11. const result = next(action);
  12. switch (action.type) {
  13. case APP_WILL_MOUNT:
  14. startNetInterception(store);
  15. break;
  16. case APP_WILL_UNMOUNT:
  17. stopNetInterception(store);
  18. break;
  19. }
  20. return result;
  21. });