Exports
[<Class>]
type Exports =
static member promises: Promises
static member setImmediate: SetImmediate
static member setTimeout: SetTimeout
static member clearImmediate (?immediate: Immediate) : unit
static member clearInterval (?timeout: U3<string,float,Timeout>) : unit
static member clearTimeout (?timeout: U3<string,float,Timeout>) : unit
static member setInterval (callback: unit -> unit, ?delay: float) : Timeout
static member setInterval<'TArgs> (callback: 'TArgs -> unit, delay: float option, args: 'TArgs) : Timeout| Assembly | Xantham.Fable.Node |
| Attributes | [<Erase>] |
The package's value exports, each bound to its import.
Properties
static member setImmediate: SetImmediate
static member setImmediate: SetImmediateSchedules the "immediate" execution of the callback after I/O events' callbacks.
When multiple calls to setImmediate() are made, the callback functions are queued for execution in the order in which they are created. The entire callback queue is processed every event loop iteration. If an immediate timer is queued from inside an executing callback, that timer will not be triggered until the next event loop iteration.
If callback is not a function, a TypeError will be thrown.
This method has a custom variant for promises that is available using timersPromises.setImmediate().
@since v0.9.1
| Parameter | |
|---|---|
callback | The function to call at the end of this turn of the Node.js Event Loop |
args | Optional arguments to pass when the callback is called. |
Returns. for use with clearImmediate()
static member setTimeout: SetTimeout
static member setTimeout: SetTimeoutSchedules execution of a one-time callback after delay milliseconds.
The callback will likely not be invoked in precisely delay milliseconds. Node.js makes no guarantees about the exact timing of when callbacks will fire, nor of their ordering. The callback will be called as close as possible to the time specified.
When delay is larger than 2147483647 or less than 1 or NaN, the delay will be set to 1. Non-integer delays are truncated to an integer.
If callback is not a function, a TypeError will be thrown.
This method has a custom variant for promises that is available using timersPromises.setTimeout().
@since v0.0.1
| Parameter | |
|---|---|
callback | The function to call when the timer elapses. |
delay | The number of milliseconds to wait before calling the callback. Default:1. |
args | Optional arguments to pass when the callback is called. |
Returns. for use with clearTimeout()
Methods
static member clearImmediate (?immediate: Immediate) : unit
static member clearImmediate (?immediate: Immediate) : unitCancels an Immediate object created by setImmediate().
@since v0.9.1
| Parameter | |
|---|---|
immediate | An Immediate object as returned by setImmediate(). |
static member clearInterval (?timeout: U3<string,float,Timeout>) : unit
static member clearInterval (?timeout: U3<string,float,Timeout>) : unitCancels a Timeout object created by setInterval().
@since v0.0.1
| Parameter | |
|---|---|
timeout | A Timeout object as returned by setInterval() or the primitive of the Timeout object as a string or a number. |
static member clearTimeout (?timeout: U3<string,float,Timeout>) : unit
static member clearTimeout (?timeout: U3<string,float,Timeout>) : unitCancels a Timeout object created by setTimeout().
@since v0.0.1
| Parameter | |
|---|---|
timeout | A Timeout object as returned by setTimeout() or the primitive of the Timeout object as a string or a number. |
static member setInterval (callback: unit -> unit, ?delay: float) : Timeout
static member setInterval (callback: unit -> unit, ?delay: float) : TimeoutSchedules repeated execution of callback every delay milliseconds.
When delay is larger than 2147483647 or less than 1 or NaN, the delay will be set to 1. Non-integer delays are truncated to an integer.
If callback is not a function, a TypeError will be thrown.
This method has a custom variant for promises that is available using timersPromises.setInterval().
@since v0.0.1
| Parameter | |
|---|---|
callback | The function to call when the timer elapses. |
delay | The number of milliseconds to wait before calling the callback. Default:1. |
args | Optional arguments to pass when the callback is called. |
Returns. for use with clearInterval()
static member setInterval<'TArgs> (callback: 'TArgs -> unit, delay: float option, args: 'TArgs) : Timeout
static member setInterval<'TArgs> (callback: 'TArgs -> unit, delay: float option, args: 'TArgs) : TimeoutSchedules repeated execution of callback every delay milliseconds.
When delay is larger than 2147483647 or less than 1 or NaN, the delay will be set to 1. Non-integer delays are truncated to an integer.
If callback is not a function, a TypeError will be thrown.
This method has a custom variant for promises that is available using timersPromises.setInterval().
@since v0.0.1
| Parameter | |
|---|---|
callback | The function to call when the timer elapses. |
delay | The number of milliseconds to wait before calling the callback. Default:1. |
args | Optional arguments to pass when the callback is called. |
Returns. for use with clearInterval()