Is there any way to wait until a store is persisted after a set call? #2768
Unanswered
shinobu-uwu
asked this question in
Q&A
Replies: 1 comment
-
Thanks for reporting. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I have a store that is being used both by a service worker and a web page. I'm facing a few synchronization issues, and what I did to fix them was calling
store.persist.rehydrate()
on my page after the service worker operation completed, however the values are stillundefined
after the rehydrate call, which is async btw.My guess is that it's being rehydrated with the wrong values because the service worker store didn't finish persisting the new values. So I decided to add a
sleep
call to the service worker call before returning and it started working, however this is not good and I'd like to know if there is a way to wait for the changes to be persisted.Beta Was this translation helpful? Give feedback.
All reactions