This small update allows you to integrate better with some other redux libraries, like redux-batched-actions.
From now on you can intercept what's being dispatched before it's emitted into the saga, which will allow for using take
just like everybody else, instead of playing with the pattern
argument.
The argument you need to pass to the middleware is a higher-order function which will first take out built-in emit
function as the argument and return a 'middleware' function to process dispatched action
s.
Example usage:
createSagaMiddleware({
emitter: emit => action => {
if (Array.isArray(action)) {
action.forEach(emit);
return
}
emit(action)
}
});
More can be read in our docs
Great thanks to the @pbadenski for implementing the feature.