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.ts 840B

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