From bc2b50bc089e6e13b276398eec14312884ab785c Mon Sep 17 00:00:00 2001 From: cha0s Date: Thu, 10 Dec 2020 06:36:52 -0600 Subject: [PATCH] chore: middleware --- packages/state/src/client/store.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/state/src/client/store.js b/packages/state/src/client/store.js index b777b6f..c38e0ae 100644 --- a/packages/state/src/client/store.js +++ b/packages/state/src/client/store.js @@ -8,7 +8,7 @@ import effectsMiddleware from './effects'; import {storageSubscription} from './storage'; export default async function configureStore(latus, options = {}) { - const {history} = options; + const {history, middleware = []} = options; const reducers = await ensureUniqueReduction(latus, '@reddichat/state/reducers', options); const {defaultState} = latus.config['@reddichat/state/client']; const reducer = combineReducers(reducers); @@ -20,6 +20,7 @@ export default async function configureStore(latus, options = {}) { ...getDefaultMiddleware(), routerMiddleware(history), effectsMiddleware(latus), + ...middleware, ], preloadedState: reducer(defaultState, {type: null}), reducer,