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

reducer.js 573B

1234567891011121314151617181920212223242526
  1. // @flow
  2. import { ReducerRegistry } from '../redux';
  3. import { PersistenceRegistry } from '../storage';
  4. import { PROFILE_UPDATED } from './actionTypes';
  5. const STORE_NAME = 'features/base/profile';
  6. /**
  7. * Sets up the persistence of the feature base/profile.
  8. */
  9. PersistenceRegistry.register(STORE_NAME);
  10. ReducerRegistry.register(
  11. STORE_NAME, (state = {}, action) => {
  12. switch (action.type) {
  13. case PROFILE_UPDATED:
  14. return {
  15. ...state,
  16. ...action.profile
  17. };
  18. }
  19. return state;
  20. });