Listening for persisting to storage completion
I'm using v4 and localForage to store the state.
Looking at the source code of redux-persist I think It is trivial to add couple of lines to notified whether persisting is complete
persisting happens all the time, is there a reason you want to be notified? Also v5 has a flush method that returns a promise which when resolved means "persist is complete", perhaps that can work for your use case?
I seem to forget why I was asking this. I think it is because I need to synchronize the state between two opened tabs. Changing the state on one tab will trigger persisting, but the other wouldn't know and you'll end up with diff state between the two tabs. So, what I think would solve the problem is to have a listener on every persisting completion. With that, I could notify the other tab to load again from the storage.
I seem to forget why I was asking this. I think it is because I need to synchronize the state between two opened tabs. Changing the state on one tab will trigger persisting, but the other wouldn't know and you'll end up with diff state between the two tabs. So, what I think would solve the problem is to have a listener on every persisting completion. With that, I could notify the other tab to load again from the storage.
I try to achieve the same thing, any update on this?