time-to-botec/js/node_modules/@stdlib/utils/next-tick
NunoSempere b6addc7f05 feat: add the node modules
Necessary in order to clearly see the squiggle hotwiring.
2022-12-03 12:44:49 +00:00
..
docs feat: add the node modules 2022-12-03 12:44:49 +00:00
lib feat: add the node modules 2022-12-03 12:44:49 +00:00
package.json feat: add the node modules 2022-12-03 12:44:49 +00:00
README.md feat: add the node modules 2022-12-03 12:44:49 +00:00

nextTick

Add a callback to the "next tick queue".

Usage

var nextTick = require( '@stdlib/utils/next-tick' );

nextTick( clbk[, ...args] )

Adds a callback to the "next tick queue".

function beep() {
    console.log( 'boop' );
}

nextTick( beep );

Notes

  • The queue is fully drained after the current operation on the JavaScript stack runs to completion and before the event loop is allowed to continue.
  • Creating an infinite loop is possible if nextTick is called recursively.

Examples

var nextTick = require( '@stdlib/utils/next-tick' );

function beep( x, y, z ) {
    console.log( 'boop: %d %d %d', x, y, z );
}

nextTick( beep, 1, 2, 3 );