Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<meta charset="utf-8">
<title>Test React Scheduler</title>
<script src="rs.js"></script>
<button onclick="runTest()">Run test</button>
<script>
const TEST_DURATION = 300000;
@shaseley
shaseley / abortsignal-any-poc.js
Created May 4, 2023 21:29
AbortSignal.any() polyfill order POC
<script>
let abortProto = AbortController.prototype;
let oldAbort = AbortController.prototype.abort;
Object.assign(abortProto, {
abort(reason) {
oldAbort.call(this, reason);
if (this.signal.__dependents) {
for (let controller of this.signal.__dependents) {

Supporting Multiple Signals on the Web Platform

Introduction

The signal/controller pattern was introduced as the way to control ongoing async work, initially for cancellation via AbortController and AbortSignal.