Skip to content

Commit

Permalink
chore: comment the delegation of setTimeout, et al.
Browse files Browse the repository at this point in the history
  • Loading branch information
cartant committed Oct 31, 2020
1 parent 5516a82 commit 72170ff
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/internal/testing/TestScheduler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,18 @@ export class TestScheduler extends VirtualTimeScheduler {
throw new Error('Expected a due immediate or interval');
};

// The following objects are the delegates that replace conventional
// runtime implementations with TestScheduler implementations.
//
// The immediate delegate is depended upon by the asapScheduler.
//
// The setInterval delegate is depended upon by the asyncScheduler.
//
// The setTimeout delegate is not depended upon by any scheduler, but it's
// included here because the onUnhandledError and onStoppedNotification
// configuration points use setTimeout to avoid producer interference. It's
// inclusion allows for the testing of these configuration points.

const immediate = {
setImmediate: (handler: () => void) => {
const handle = ++lastHandle;
Expand Down

0 comments on commit 72170ff

Please sign in to comment.