Closed cha0s closed 5 years ago
I also noticed that the build changed a lot of whitespace, so this link makes it easier to see the "real" changeset: https://github.com/cyrilluce/saga-duck/pull/4/files?utf8=%E2%9C%93&diff=unified&w=1
Hi cha0s, cause I can't modify your pull request, I have commit a compatible version of enhancers feature, Thanks for your contribution!
DuckRuntime
allows passing inmiddlewares
as a rest parameter. However, this is not flexible enough for all uses.applyMiddleware
is a store enhancer. I understand the motivation behind automatically applyingsagaMiddleware
, so the case for keepingmiddlewares
is good. However, there is no good way to compose any other store enhancers when constructingDuckRuntime
.This PR changes
DuckRuntime
's constructor's function signature from acceptingmiddlewares
as a rest parameter to acceptingmiddlewares
as a second optional array parameter, and acceptingenhancers
as a third optional array parameter.Store enhancers are now
compose
d after theapplyMiddleware
enhancer which is constructed as normal.NB: I also refactored the
createReduxStore
call, as it was non-idiomatic and would become overly complicated with the introduction of store enhancers.