Savely store a persistent value before location reload #4797
-
|
Maybe there is a better approach, but I found that even though there is a new version of the SPA (with correct js file versioning), it takes a while for the users to pick it up. When there is a critical update I want to force a location reload to get the latest version immediately. Currently, I have this approach: Is it save to assume that the version value gets always stored before the location reloads? Or is there even a better approach in general? PS: I am aware of some browser settings that lead to localstorage getting cleared out after closing the browser (window). But localstorage cannot be disabled during the session, can it? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
I believe it is safe to assume. LocalStorage is synchronous, so it will write before the tick is even queued. |
Beta Was this translation helpful? Give feedback.
I believe it is safe to assume.
LocalStorage is synchronous, so it will write before the tick is even queued.