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

reducer.js 722B

1234567891011121314151617181920212223242526272829303132333435
  1. // @flow
  2. import { ReducerRegistry } from '../../base/redux';
  3. import {
  4. _SET_APP_STATE_LISTENER,
  5. APP_STATE_CHANGED
  6. } from './actionTypes';
  7. /**
  8. * The default/initial redux state of the feature background.
  9. */
  10. const DEFAULT_STATE = {
  11. appState: 'active'
  12. };
  13. ReducerRegistry.register(
  14. 'features/background',
  15. (state = DEFAULT_STATE, action) => {
  16. switch (action.type) {
  17. case _SET_APP_STATE_LISTENER:
  18. return {
  19. ...state,
  20. appStateListener: action.listener
  21. };
  22. case APP_STATE_CHANGED:
  23. return {
  24. ...state,
  25. appState: action.appState
  26. };
  27. }
  28. return state;
  29. });