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

reducer.js 631B

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