Skip to content

Application would stop working in case of a reducer error#7

Open
arieh wants to merge 1 commit intoabc123s:masterfrom
arieh:handle-action-errors
Open

Application would stop working in case of a reducer error#7
arieh wants to merge 1 commit intoabc123s:masterfrom
arieh:handle-action-errors

Conversation

@arieh
Copy link

@arieh arieh commented Apr 19, 2017

Current implementation would make the dispatch function stop working in case of a broken reducer within a batch, since the batch counter would never reset properly:

Example:

/*
this would make redux throw an error, which would also freeze `batchDepth` at 1. 
Subsequent dispatches will never reach the listeners.
*/
store.dispatch(["foo"]);

Although redux already wraps the reducers in a try block, if any other middleware overrides dispatch in a way that doesn't produce 100% breakage, or if user has a broken action, application would stop working completely until a refresh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant