Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { combineReducers } from 'redux-immutable';
// Reducers
import { loginReducer } from './login/login.js';
import { modalsReducer } from './modals/modals.js';
import { viewportReducer } from './viewport/viewport.js';
import { fetchedDataReducer } from './fetched-data/fetched-data.js';
import { toastersReducer } from './toaster/toaster.js';
import { sideMenuReducer } from './side-menu/side-menu.js';
import routeReducer from './route-reducer.js';
const app = combineReducers({
viewport: viewportReducer,
routing: routeReducer,
modals: modalsReducer,
session: loginReducer,
toasters: toastersReducer,
sideMenu: sideMenuReducer,
fetchedData: fetchedDataReducer,
});
export default app;
export const generateStore = lrs => createStore(
combineReducers({ linkedObjects: linkReducer }),
applyMiddleware(linkMiddleware(lrs)),
);
function combineReducersInner(asyncReducers, state) {
if (isImmutable(state)) {
return combineImmutableReducers({
...asyncReducers,
});
}
return combineReducers({
...asyncReducers,
});
}
function toCombineReducers(reducers: Object) {
const tempReducers = Object.keys(reducers).reduce((prev, current) => {
const currentReducer = reducers[current];
prev[current] = _.isFunction(currentReducer)
? currentReducer
: toCombineReducers(currentReducer);
return prev;
}, {});
return combineReducers(tempReducers);
}
/*
import { combineReducers } from 'redux-immutable';
import defaultUserAgent from './defaultUserAgent';
import hotKeySearchWindow from './hotKeySearchWindow';
import language from './language';
const configReducer = combineReducers({
defaultUserAgent,
hotKeySearchWindow,
language,
});
export default configReducer;
export default function createReducer(injectedReducers) {
return combineReducers({
route: routeReducer,
language: languageProviderReducer,
...initialReducers,
...injectedReducers,
});
}
export default function createReducer (injectedReducers: ReducersMapObject = {}): Reducer {
return combineReducers({
route: routeReducer,
language: languageProviderReducer,
report: reportReducer,
...injectedReducers
})
}
export default function createReducer (injectedReducers: ReducersMapObject = {}): Reducer {
return combineReducers({
route: routeReducer,
language: languageProviderReducer,
...injectedReducers
})
}
export default function createReducer(injectedReducers) {
return combineReducers({
route: routeReducer,
global: globalReducer,
...injectedReducers,
});
}
export default function createReducer(injectedReducers) {
return combineReducers({
route: routeReducer,
language: languageProviderReducer,
global: globalReducer,
...injectedReducers,
});
}