dnssd.js icon indicating copy to clipboard operation
dnssd.js copied to clipboard

Use node timers explicitly (for use with Electron)

Open jpoppe opened this issue 6 years ago • 3 comments

See commits for more info.

jpoppe avatar Jul 10 '18 21:07 jpoppe

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

jaller94 avatar Oct 11 '18 09:10 jaller94

@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).

jpoppe avatar Oct 12 '18 07:10 jpoppe

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

jaller94 avatar Oct 12 '18 07:10 jaller94