From 6edcf747e10919605b05b905214fe1d3286898e3 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 15 Oct 2019 11:20:00 -0400 Subject: [PATCH] always call callback if matching action is fired --- dist/bundle.es.js | 8 ++++---- src/redux/middleware/shared-state.js | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dist/bundle.es.js b/dist/bundle.es.js index c7e96e3..f860318 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -1469,11 +1469,11 @@ const buildSharedStateMiddleware = (actions, sharedStateFilters, sharedStateCb) // only update if the preference changed from last call in the same session oldShared = shared; doPreferenceSet(SHARED_PREFERENCE_KEY, shared, SHARED_PREFERENCE_VERSION); + } - if (sharedStateCb) { - // Pass dispatch to the callback to consumers can dispatch actions in response to preference set - sharedStateCb({ dispatch, getState }); - } + if (sharedStateCb) { + // Pass dispatch to the callback to consumers can dispatch actions in response to preference set + sharedStateCb({ dispatch, getState }); } return actionResult; diff --git a/src/redux/middleware/shared-state.js b/src/redux/middleware/shared-state.js index 010638b..a211b16 100644 --- a/src/redux/middleware/shared-state.js +++ b/src/redux/middleware/shared-state.js @@ -40,11 +40,11 @@ export const buildSharedStateMiddleware = ( // only update if the preference changed from last call in the same session oldShared = shared; doPreferenceSet(SHARED_PREFERENCE_KEY, shared, SHARED_PREFERENCE_VERSION); + } - if (sharedStateCb) { - // Pass dispatch to the callback to consumers can dispatch actions in response to preference set - sharedStateCb({ dispatch, getState }); - } + if (sharedStateCb) { + // Pass dispatch to the callback to consumers can dispatch actions in response to preference set + sharedStateCb({ dispatch, getState }); } return actionResult;