Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle case when setImmediate is not available in the browser #2728

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ghQueueMicrotask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
// Because Gesture Handler supports versions 0.64+, we have to handle situations where someone uses older version of react native.
// That's why if `queueMicrotask` doesn't exist, we use `setImmediate` instead, since it was used before we switched to `queueMicrotask` in version 2.11.0
export const ghQueueMicrotask =
typeof queueMicrotask === 'function' ? queueMicrotask : setImmediate;
typeof queueMicrotask === 'function' ? queueMicrotask : (typeof setImmediate === "function" ? setImmediate : setTimeout);

Check failure on line 5 in src/ghQueueMicrotask.ts

View workflow job for this annotation

GitHub Actions / check

Replace `·?·queueMicrotask·:·(typeof·setImmediate·===·"function"·?·setImmediate·:·setTimeout)` with `⏎····?·queueMicrotask⏎····:·typeof·setImmediate·===·'function'⏎····?·setImmediate⏎····:·setTimeout`
Loading