fix(persist): use latest state in post-rehydration callback (#3391)
Before adoption: this commit came in with the history the project adopted, so no landing records it.
* fix(persist): use latest state in post-rehydration callback Pass current store state to post-rehydration callback to avoid stale values after hydration-triggered updates. Add async persist regression test that updates state during hydration and asserts callback receives latest state. * Update src/middleware/persist.ts ---------
authored by Shohjahon · committed by GitHub · parent a3869ca · Browse files · 2 files+55 added−6 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Trailers
- Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
Diff stats
2 files+55 added−6 removed
- tests:+54 added−0 removed
- other:+1 added−6 removed