Open ronag opened 8 years ago
So, redux-effects itself is just a composition strategy for the other effect middleware. redux-effects-events for instance binds event handlers, which obviously don't fit well into the steps
model.
Your particular middleware is totally free to just accept its own lambda that it executes in response to something happening in the environment. I would recommend using steps
for either your onCompleted
event, or for returning a value that is necessary to cancel the process if you have such a thing.
It might be interesting to come up with a general pattern for handling this style of listener though. It could be totally independent of redux-effects. A redux-observable that handles returned observables would be interesting.
Would be interesting to add support for a RxJS based streams instead of steps.
In particular, in our application we want to fetch a list of items, and instead of getting the entire list in a large
success
call we would prefer something likeonNext
,onError
,onCompleted
.Any thoughts on that?