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 706B

12345678910111213141516171819202122232425262728
  1. // @flow
  2. import { ReducerRegistry, set } from '../redux';
  3. import { SET_ASPECT_RATIO, SET_REDUCED_UI } from './actionTypes';
  4. import { ASPECT_RATIO_NARROW } from './constants';
  5. /**
  6. * The default/initial redux state of the feature base/responsive-ui.
  7. */
  8. const DEFAULT_STATE = {
  9. aspectRatio: ASPECT_RATIO_NARROW,
  10. reducedUI: false
  11. };
  12. ReducerRegistry.register(
  13. 'features/base/responsive-ui',
  14. (state = DEFAULT_STATE, action) => {
  15. switch (action.type) {
  16. case SET_ASPECT_RATIO:
  17. return set(state, 'aspectRatio', action.aspectRatio);
  18. case SET_REDUCED_UI:
  19. return set(state, 'reducedUI', action.reducedUI);
  20. }
  21. return state;
  22. });