mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
Unify serverAct helpers (#33327)
This uses the richer `serverAct` helper that we already use in other tests. This avoids using the `Scheduler`. We don't use that package on the server so it doesn't make sense to simulate going through it. Additionally, we really should be getting rid of it on the client too to favor `postTask` polyfills.
This commit is contained in:
committed by
GitHub
parent
1835b3f7d9
commit
1c43d0aed7
@@ -1,13 +1,7 @@
|
||||
'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.'
|
||||
);
|
||||
}
|
||||
|
||||
export function patchSetImmediate() {
|
||||
global.setImmediate = cb => {
|
||||
Scheduler.unstable_scheduleCallback(Scheduler.unstable_NormalPriority, cb);
|
||||
setTimeout(cb, 0);
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user