mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
16 lines
487 B
Markdown
16 lines
487 B
Markdown
Globals module for defining functions part of the global context - you need only to call *require* for this module and all globals will be registered. For example setTimeout:
|
|
```js
|
|
require("globals");
|
|
|
|
setTimeout(function(){ log("Test"); }, 2000);
|
|
|
|
var id = setTimeout(function(){ log("Test"); }, 2000);
|
|
...
|
|
clearTimeout(id);
|
|
|
|
setInterval(function(){ log("Test"); }, 2000);
|
|
|
|
var intervalId = setInterval(function(){ log("Test"); }, 2000);
|
|
...
|
|
clearInterval(intervalId)
|
|
``` |