You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This works fine because it does nothing but wait and then return to JavaScript where we can execute the callback.
But how could we implement setInterval?
We need to execute the JavaScript callback after every delay, and also return a timer ID so that JavaScript could cancel it later. I don't get how to do all of that in a single function.
So, could you please help me? Thanks in advance!
The text was updated successfully, but these errors were encountered:
Generally when implementing something like setInterval, you'd want to learn towards providing a stream to JS. You'd provide an async op that picks off the next item from a Stream's next function and just call that repeatedly.
Hello.
I had so much fun following this tutorial.
I implemented setTimeout using the answer to my question here denoland/deno#19231
This works fine because it does nothing but wait and then return to JavaScript where we can execute the callback.
But how could we implement setInterval?
We need to execute the JavaScript callback after every delay, and also return a timer ID so that JavaScript could cancel it later. I don't get how to do all of that in a single function.
So, could you please help me? Thanks in advance!
The text was updated successfully, but these errors were encountered: