Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

reducer.js 933B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // @flow
  2. import { ReducerRegistry } from '../base/redux';
  3. import {
  4. SET_GOOGLE_API_PROFILE,
  5. SET_GOOGLE_API_STATE
  6. } from './actionTypes';
  7. import { GOOGLE_API_STATES } from './constants';
  8. /**
  9. * The default state is the Google API needs loading.
  10. *
  11. * @type {{googleAPIState: number}}
  12. */
  13. const DEFAULT_STATE = {
  14. googleAPIState: GOOGLE_API_STATES.NEEDS_LOADING,
  15. profileEmail: ''
  16. };
  17. /**
  18. * Reduces the Redux actions of the feature features/google-api.
  19. */
  20. ReducerRegistry.register('features/google-api',
  21. (state = DEFAULT_STATE, action) => {
  22. switch (action.type) {
  23. case SET_GOOGLE_API_STATE:
  24. return {
  25. ...state,
  26. googleAPIState: action.googleAPIState
  27. };
  28. case SET_GOOGLE_API_PROFILE:
  29. return {
  30. ...state,
  31. profileEmail: action.profileEmail
  32. };
  33. }
  34. return state;
  35. });