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,