-
I am trying to setup a setInterval to poll the api server for updated data on a regular schedule. I am having trouble figuring out where to write the setInterval so that it is guaranteed to run once in the browser. Any ideas? |
Beta Was this translation helpful? Give feedback.
Answered by
DrDanRyan
Aug 26, 2022
Replies: 1 comment
-
I think I figured out that you can safely do this in the |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
DrDanRyan
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think I figured out that you can safely do this in the
onMount
hook of the main layout and it will then run once and guaranteed to be in the browser.