redux-state-sync
redux-state-sync copied to clipboard
Default individual values in createStateSyncMiddleware
export const createStateSyncMiddleware = (config = defaultConfig) => {
const allowed = isActionAllowed(config);
const channel = new BroadcastChannel(config.channel, config.broadcastChannelOption);
const prepareState = config.prepareState || defaultConfig.prepareState;
let messageListener = null;
the above only defaults to the defaultConfig
if no config option is provided. I want to do something like this
const stateSyncMiddleware = createStateSyncMiddleware({
whitelist: [ActionToWhitelist],
})
I think it makes sense to default the rest of the values if only one is provided.
All tests are passing, and this change should be backwards compatible!