always call callback if matching action is fired

This commit is contained in:
Sean Yesmunt 2019-10-15 11:20:00 -04:00
parent 4c4f926ee2
commit 6edcf747e1
2 changed files with 8 additions and 8 deletions

8
dist/bundle.es.js vendored
View file

@ -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;

View file

@ -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;