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

Use node timers explicitly (for use with Electron) #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jpoppe
Copy link
Contributor

@jpoppe jpoppe commented Jul 10, 2018

See commits for more info.

When the node timers are not explicitly set this library can't be used directly with the client side of Electron, when timers method are used explicitly Electron is able to recognize those and make them work on the client side.
@jaller94
Copy link

@jpoppe What is the advantage of the Electron timers over the JavaScript standard?

@jpoppe
Copy link
Contributor Author

jpoppe commented Oct 12, 2018

@jaller94 it is not about 'using electron timers'

This pull requests explicitly imports (requires) the node timers module so setInterval will now be called with timers.setInterval.

This will still be the same node timer (and nothing will change when this library is used with node), but without this require Electron is unable to determine that setInterval comes from node and would try to use the browser's built-in setInterval and would fail since it is incompatible (at least in this context).

@jaller94
Copy link

Thanks. I am not familiar with Electron development and got curious of why a library should adapt for one framework.

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.

2 participants