0.2.1 • Published 2 months ago

@stdlib/utils-next-tick v0.2.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
2 months ago

nextTick

NPM version Build Status Coverage Status

Add a callback to the "next tick queue".

Installation

npm install @stdlib/utils-next-tick

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 );

Notice

This package is part of stdlib, a standard library for JavaScript and Node.js, with an emphasis on numerical and scientific computing. The library provides a collection of robust, high performance libraries for mathematics, statistics, streams, utilities, and more.

For more information on the project, filing bug reports and feature requests, and guidance on how to develop stdlib, see the main project repository.

Community

Chat


License

See LICENSE.

Copyright

Copyright © 2016-2024. The Stdlib Authors.

@infinitebrahmanuniverse/nolb-_stdlib_u@everything-registry/sub-chunk-871@zalastax/nolb-_stdlib_u@stdlib/net-disposable-http-server@stdlib/process-read-stdin@stdlib/repl-presentation@stdlib/random-streams-rayleigh@stdlib/random-streams-t@stdlib/random-streams-triangular@stdlib/random-streams-uniform@stdlib/random-streams-weibull@stdlib/random-streams-randi@stdlib/random-streams-randn@stdlib/random-streams-randu@stdlib/random-streams-binomial@stdlib/random-streams-box-muller@stdlib/random-streams-cauchy@stdlib/random-streams-chi@stdlib/random-streams-chisquare@stdlib/random-streams-cosine@stdlib/random-streams-discrete-uniform@stdlib/random-streams-erlang@stdlib/random-streams-exponential@stdlib/random-streams-f@stdlib/random-streams-frechet@stdlib/random-streams-gamma@stdlib/random-streams-arcsine@stdlib/random-streams-bernoulli@stdlib/random-streams-beta@stdlib/random-streams-betaprime@stdlib/random-streams-geometric@stdlib/random-streams-gumbel@stdlib/random-streams-hypergeometric@stdlib/random-streams-improved-ziggurat@stdlib/random-streams-invgamma@stdlib/random-streams-kumaraswamy@stdlib/random-streams-laplace@stdlib/random-streams-levy@stdlib/random-streams-logistic@stdlib/random-streams-lognormal@stdlib/random-streams-minstd@stdlib/random-streams-minstd-shuffle@stdlib/random-streams-mt19937@stdlib/random-streams-negative-binomial@stdlib/random-streams-normal@stdlib/random-streams-pareto-type1@stdlib/random-streams-poisson@stdlib/streams-node-empty@stdlib/streams-node-from-array@stdlib/streams-node-from-circular-array@stdlib/streams-node-from-constant@stdlib/streams-node-from-iterator@stdlib/streams-node-from-strided-array@stdlib/streams-node-transform@stdlib/streams-node-inspect@stdlib/streams-node-inspect-sink@stdlib/streams-node-join@stdlib/streams-node-split@stdlib/utils-timeit@stdlib/utils-timeit-cli
0.2.1

2 months ago

0.2.0

2 months ago

0.1.0

7 months ago

0.1.1

7 months ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago

0.0.1-alpha.10

3 years ago

0.0.1-alpha.9

3 years ago

0.0.1-alpha.8

3 years ago

0.0.1-alpha.7

3 years ago

0.0.1-alpha.6

3 years ago

0.0.1-alpha.5

3 years ago

0.0.1-alpha.4

3 years ago

0.0.1-alpha.2

3 years ago

0.0.1-alpha.3

3 years ago

0.0.1-alpha.1

3 years ago

0.0.1-alpha.0

3 years ago