Echo JS 0.11.0

<~>

tracker1 1039 days ago. link 1 point
somewhat useful package... I usually just put the following at the top of js modules that need it..

    const delay = ms => new Promise(r => setTimeout(r, ms));

Then I can use `await delay(10)` or whatever in practice.  Often after file operations, so they can sync up before continuing (more for windows antivirus, etc) in node... or to slow down certain operations in a browser.

I will also use this when stubbing API clients when the server-side isn't ready, or similar on the server to simulate longer loads to check UI/UX behaviors.
niksy 884 days ago. link 1 point
I also used same approach, but this is now standardized and has aborting support via `AbortController`.

Plus, if you need `setInterval`, it’s not that trivial.