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

Call setTimeout instead of setImmediate when running in the browser #56

Merged
merged 1 commit into from Mar 26, 2023

Conversation

dimfeld
Copy link
Contributor

@dimfeld dimfeld commented Mar 18, 2023

setImmediate isn't implemented in any modern browser, so this updates the memory storage engine to call setTimeout instead when running in the browser. Behavior under Node is unchanged.

Note that this uses globalThis, which is only supported in Node 12+.

Resolves #55

Copy link
Owner

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Owner

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm on green CI

@mcollina mcollina merged commit 61b7bb2 into mcollina:main Mar 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Browsers do not implement setImmediate
2 participants