您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

reducer.js 690B

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