Closed
Description
Expected Behavior
DataLoader should gracefully fall back to setTimeout
if setImmediate
is not supported on the browser.
Current Behavior
It crashes with an error ReferenceError: setImmediate is not defined
.
Possible Solution
Line 242 in 249b2b9
- setImmediate || setTimeout;
+ typeof setImmediate === 'function' ?
+ setImmediate :
+ (fn => {setTimeout(fn, 0);});
This code also fixes a problem of calling setTimeout
without a delay number when it falls back.
Sorry, I didn't create a PR as I am not familiar with the Flow typing that this project is based on.