File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ export interface RuntimeFrameScheduler {
2020 cancelDirty ( component : unknown ) : void ;
2121 flushNow ( ) : void ;
2222 clear ( ) : void ;
23+ /** Marker property to identify the default noop scheduler. */
24+ [ NOOP_SCHEDULER_MARKER ] ?: true ;
2325}
2426
2527export interface RuntimeWriteLock {
@@ -42,15 +44,23 @@ export function createWriteLock(): RuntimeWriteLock {
4244
4345// ── Pre‑init defaults (overwritten by spawn/renderer.ts at import time) ──
4446
45- let current : RuntimeSingletons = {
46- writeLock : createWriteLock ( ) ,
47- writeContext : new AsyncLocalStorage < true > ( ) ,
48- frameScheduler : {
47+ /** Sentinel tag to identify the default noop scheduler. */
48+ const NOOP_SCHEDULER_MARKER = Symbol ( "no-op-scheduler" ) ;
49+
50+ function createNoopScheduler ( ) : RuntimeFrameScheduler {
51+ return {
4952 markDirty : ( ) => { } ,
5053 cancelDirty : ( ) => { } ,
5154 flushNow : ( ) => { } ,
5255 clear : ( ) => { } ,
53- } ,
56+ [ NOOP_SCHEDULER_MARKER ] : true ,
57+ } ;
58+ }
59+
60+ let current : RuntimeSingletons = {
61+ writeLock : createWriteLock ( ) ,
62+ writeContext : new AsyncLocalStorage < true > ( ) ,
63+ frameScheduler : createNoopScheduler ( ) ,
5464} ;
5565
5666// ── Public API ────────────────────────────────────────────────────────
You can’t perform that action at this time.
0 commit comments