You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

reducer.js 614B

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