Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

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. });