Error handling
Let's face it. Errors coming from redux-saga
were unreadable and made finding a root cause of the problem really difficult. We really want to improve this situation and with this release (thanks to @restrry's amazing contribution) we start to log "saga stacks" along with original errors. This works similar to what React already does with its "component stacks". Just look at this one:
You can even enhance those stacks with file names and line numbers by using in development our new babel-plugin-redux-saga (also thanks to @restrry). Let us know if there are any issues with this or if we can make them even more useful!
Also onError
should get called now even if you throw non-Errors in your code.
Beside that few things have changed, you can read more about them below.
Added:
takeLeading
effect - it takes "leading" action and ignores all incoming ones of the same type while the "leading" is still handled (useful for things debouncing)- redux@4 got in supported range (this will let npm dedupe redux in
node_modules
, keep in mind though that we only depend oncompose
from that package)
Changed:
delay
became an effect, you still can importdelay
util fromredux-saga/utils
though