Skip to content

how to access store from register-service-worker.js #14927

Answered by ssuess
ssuess asked this question in CLI - PWA mode
Discussion options

You must be logged in to vote

As mentioned in comment above, answer is: race condition

UGH, I think I finally see why. If I do this in my register-service-worker.js file, I get the data:

setTimeout(() => { console.log('store', store.state.rstruth) }, 1500)

race conditions. The bane of my existence.

Replies: 2 comments 7 replies

Comment options

You must be logged in to vote
7 replies
@ssuess
Comment options

@metalsadman
Comment options

@ssuess
Comment options

@ssuess
Comment options

@ssuess
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by ssuess
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants