Change `update` to `getState`
See original GitHub issueIn thunks, we do not know the current state because maybe some other actions has changed the state during the thunk. So you offered an update
function.
But a better solution is offer a getState
function…
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
redux getState() doesn't return the updated state
The problem that made me stuck for days is that although my redux devtool shows the successful state update without any kind ...
Read more >Actions and reducers: updating state - Human Redux
The simplest possible way to update a view is just store.subscribe() and then in that function, call store.getState() and re-render. ... For our...
Read more >Store - Redux
Dispatches an action. This is the only way to trigger a state change. The store's reducing function will be called with the current...
Read more >Why React doesn't update state immediately - LogRocket Blog
State updates in React are asynchronous; when an update is requested, there is no guarantee that the updates will be made immediately.
Read more >React setState does not immediately update the state - Medium
React setState does not immediately update the state · React State · useState React hook · How we can setState and get state...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
got it. thanks very much.
Glad you figured it out! 🎉