@@ -57,8 +57,6 @@ export type SchedulerCallback = (isSync: boolean) => SchedulerCallback | null;
5757
5858type SchedulerCallbackOptions = { timeout ?: number , ...} ;
5959
60- const fakeCallbackNode = { } ;
61-
6260// Except for NoPriority, these correspond to Scheduler priorities. We use
6361// ascending numbers so we can compare them like numbers. They start at 90 to
6462// avoid clashing with Scheduler's priorities.
@@ -147,6 +145,8 @@ export function scheduleSyncCallback(callback: SchedulerCallback) {
147145 if ( syncQueue === null ) {
148146 syncQueue = [ callback ] ;
149147 // Flush the queue in the next tick, at the earliest.
148+ // TODO: Figure out how to remove this It's only here as a last resort if we
149+ // forget to explicitly flush.
150150 immediateQueueCallbackNode = Scheduler_scheduleCallback (
151151 Scheduler_ImmediatePriority ,
152152 flushSyncCallbackQueueImpl ,
@@ -156,13 +156,10 @@ export function scheduleSyncCallback(callback: SchedulerCallback) {
156156 // we already scheduled one when we created the queue.
157157 syncQueue . push ( callback ) ;
158158 }
159- return fakeCallbackNode ;
160159}
161160
162161export function cancelCallback ( callbackNode : mixed ) {
163- if ( callbackNode !== fakeCallbackNode ) {
164- Scheduler_cancelCallback ( callbackNode ) ;
165- }
162+ Scheduler_cancelCallback ( callbackNode ) ;
166163}
167164
168165export function flushSyncCallbackQueue ( ) {
0 commit comments