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

fix: check if unref exists before calling #58

Merged
merged 2 commits into from
Jul 29, 2024
Merged

fix: check if unref exists before calling #58

merged 2 commits into from
Jul 29, 2024

Conversation

shy1132
Copy link
Contributor

@shy1132 shy1132 commented Jul 28, 2024

in some environments (namely electron's renderer process), setTimeout doesn't have an "unref" method
this simply checks if unref exists before attempting to call it

@xhayper xhayper added the enhancement New feature or request label Jul 29, 2024
@xhayper xhayper merged commit a69604a into xhayper:main Jul 29, 2024
3 checks passed
@shy1132
Copy link
Contributor Author

shy1132 commented Jul 29, 2024

i've went ahead and tested it in electron, and a69604a actually breaks it in another way due to regular setTimeout returning a number, while node's setTimeout returns a Timer

i'm not exactly sure how to check other than my initial commit, perhaps checking typeof timer first to make sure it's an object

xhayper added a commit that referenced this pull request Jul 29, 2024
@xhayper
Copy link
Owner

xhayper commented Jul 29, 2024

Released a bug fix, along with some surprise~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants