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

reducer.js 642B

1234567891011121314151617181920212223242526272829303132
  1. // @flow
  2. import { ReducerRegistry } from '../redux';
  3. import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from './actionTypes';
  4. ReducerRegistry.register('features/base/app', (state = {}, action) => {
  5. switch (action.type) {
  6. case APP_WILL_MOUNT: {
  7. const { app } = action;
  8. if (state.app !== app) {
  9. return {
  10. ...state,
  11. app
  12. };
  13. }
  14. break;
  15. }
  16. case APP_WILL_UNMOUNT:
  17. if (state.app === action.app) {
  18. return {
  19. ...state,
  20. app: undefined
  21. };
  22. }
  23. break;
  24. }
  25. return state;
  26. });