Files
react/scripts/jest/patchSetImmediate.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
379 B
JavaScript
Raw Normal View History

'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);
};
}