Closed
Description
This is an anti-pattern, first found here: reduxjs/redux-devtools#264.
I think we should protect against store.getState()
calls from inside the reducer. They make the reducer impure, and you can always pass the store state down as the third argument if this is something you’re interested in.
I think we should forbid this pattern just like we forbid dispatch()
while the reducer is running.
Same goes for subscribe()
which should never be called from inside a reducer.
A pull request to implement this is welcome.
Metadata
Metadata
Assignees
Labels
No labels