DEV Community

Discussion on: Practical Functional Programming in JavaScript - Side Effects and Purity

miketalbot profile image
Mike Talbot

The primary function of yield in js-coroutines is to test the amount of time remaining in the current idle part of a frame. You may also yield promises to await their completion.

js-coroutines is just basically providing a collaborative multi-tasking program runner. It does this by exposing everything it touches as an async function - so actually heavy lifting can be done in any pipe that can await async functions. That's enough