listenerApi.getState() delivers pre action state on persist/REHYDRATE action #3993
-
I created a listener like this
whereas REHYDRATE is the persist/REHYDRATE action from redux persist. According to the devtools this rehydrates the state. Any ideas why this happens and how I can access the rehydrated state in the listener? I tried to identify the rehydration on the state change by:
which is never triggered, as the current and previous flips from false, false to true, true. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
The reason was that in a middleware on the REHYDRATE action some async stuff was excecuted before the next(). Moved it to after next() it now works. |
Beta Was this translation helpful? Give feedback.
The reason was that in a middleware on the REHYDRATE action some async stuff was excecuted before the next(). Moved it to after next() it now works.