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

reducer.js 742B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // @flow
  2. import { ReducerRegistry } from '../redux';
  3. import { PersistenceRegistry } from '../storage';
  4. import { UPDATE_DROPBOX_TOKEN } from './actionTypes';
  5. /**
  6. * The default state.
  7. */
  8. const DEFAULT_STATE = {
  9. dropbox: {}
  10. };
  11. /**
  12. * The redux subtree of this feature.
  13. */
  14. const STORE_NAME = 'features/base/oauth';
  15. /**
  16. * Sets up the persistence of the feature {@code oauth}.
  17. */
  18. PersistenceRegistry.register(STORE_NAME);
  19. ReducerRegistry.register('features/base/oauth',
  20. (state = DEFAULT_STATE, action) => {
  21. switch (action.type) {
  22. case UPDATE_DROPBOX_TOKEN:
  23. return {
  24. ...state,
  25. dropbox: {
  26. token: action.token
  27. }
  28. };
  29. default:
  30. return state;
  31. }
  32. });