mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
14 lines
379 B
JavaScript
14 lines
379 B
JavaScript
|
|
'use strict';
|
||
|
|
|
||
|
|
export function patchSetImmediate(Scheduler) {
|
||
|
|
if (!Scheduler) {
|
||
|
|
throw new Error(
|
||
|
|
'setImmediate patch was used without providing a Scheduler implementation. If you are patching setImmediate you must provide a Scheduler.'
|
||
|
|
);
|
||
|
|
}
|
||
|
|
|
||
|
|
global.setImmediate = cb => {
|
||
|
|
Scheduler.unstable_scheduleCallback(Scheduler.unstable_NormalPriority, cb);
|
||
|
|
};
|
||
|
|
}
|