mirror of
https://github.com/whscullin/apple2js.git
synced 2024-01-12 14:14:38 +00:00
3048ec52e1
* Add `spawn` as a way of calling promise-returning blocks 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. * Adds interruptability to `spawn` Now, the task function passed to `spawn` can take an `Interrupted` argument, which is merely a method that returns `true` if the task should stop doing work. Likewise, `spawn` returns an `Interrupt` function that causes the `Interrupted` function to return `true`. * Change to using `AbortController` and `AbortSignal` Before, `spawn` used functions to interrupt and determine interruption state. Now, based on feedback from @whscullin, it uses `AbortController` and `AbortSignal`. Tests now show how the controller can be used to abort long-running tasks and API calls in the `spawn`. The also show how signals can be chained using `addEventListener`. * Fix `Apple2.tsx` Forgot to change it to use `AbortController` and `AbortSignal`. Co-authored-by: Will Scullin <scullin@scullin.com> |
||
---|---|---|
.. | ||
applesoft | ||
cards | ||
components | ||
formats | ||
intbasic | ||
roms | ||
ui | ||
apple2.ts | ||
apple2io.ts | ||
base64.ts | ||
canvas.ts | ||
cpu6502.ts | ||
debugger.ts | ||
entry2.ts | ||
entry2e.ts | ||
entry.tsx | ||
gl.ts | ||
main2.ts | ||
main2e.ts | ||
mmu.ts | ||
options.ts | ||
prefs.ts | ||
ram.ts | ||
symbols.ts | ||
types.ts | ||
util.ts | ||
videomodes.ts |