chore: middleware
This commit is contained in:
parent
207930d274
commit
bc2b50bc08
|
@ -8,7 +8,7 @@ import effectsMiddleware from './effects';
|
||||||
import {storageSubscription} from './storage';
|
import {storageSubscription} from './storage';
|
||||||
|
|
||||||
export default async function configureStore(latus, options = {}) {
|
export default async function configureStore(latus, options = {}) {
|
||||||
const {history} = options;
|
const {history, middleware = []} = options;
|
||||||
const reducers = await ensureUniqueReduction(latus, '@reddichat/state/reducers', options);
|
const reducers = await ensureUniqueReduction(latus, '@reddichat/state/reducers', options);
|
||||||
const {defaultState} = latus.config['@reddichat/state/client'];
|
const {defaultState} = latus.config['@reddichat/state/client'];
|
||||||
const reducer = combineReducers(reducers);
|
const reducer = combineReducers(reducers);
|
||||||
|
@ -20,6 +20,7 @@ export default async function configureStore(latus, options = {}) {
|
||||||
...getDefaultMiddleware(),
|
...getDefaultMiddleware(),
|
||||||
routerMiddleware(history),
|
routerMiddleware(history),
|
||||||
effectsMiddleware(latus),
|
effectsMiddleware(latus),
|
||||||
|
...middleware,
|
||||||
],
|
],
|
||||||
preloadedState: reducer(defaultState, {type: null}),
|
preloadedState: reducer(defaultState, {type: null}),
|
||||||
reducer,
|
reducer,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user