whscullin / apple2js

An Apple II emulator originally written in Javascript, now being converted to TypeScript
http://www.scullinsteel.com/apple2/
MIT License
438 stars 57 forks source link

Add `spawn` as a way of calling promise-returning blocks #131

Closed iflan closed 2 years ago

iflan commented 2 years ago

This change adds spawn which takes a no-argument, promise-returning function, calls it, and returns void. This makes it easy to call async blocks from useEffect and other places that don't take async functions, but also makes such calls explicit.