12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- import { ReducerRegistry } from '../base/redux';
-
- import {
- APP_SET_WELCOME_PAGE_DISABLED,
- APP_WILL_MOUNT,
- APP_WILL_UNMOUNT
- } from './actionTypes';
-
- ReducerRegistry.register('features/app', (state = {}, action) => {
- switch (action.type) {
- case APP_SET_WELCOME_PAGE_DISABLED:
- if (state.app === action.app) {
- return {
- ...state,
- disableWelcomePage: action.disabled
- };
- }
- break;
- case APP_WILL_MOUNT:
- if (state.app !== action.app) {
- return {
- ...state,
-
- /**
- * The one and only (i.e. singleton) App instance which is
- * currently mounted.
- *
- * @type {App}
- */
- app: action.app
- };
- }
- break;
-
- case APP_WILL_UNMOUNT:
- if (state.app === action.app) {
- return {
- ...state,
- app: undefined
- };
- }
- break;
- }
-
- return state;
- });
|