1.0.2 • Published 8 years ago

call-once-after-tick v1.0.2

Weekly downloads
6
License
MIT
Repository
github
Last release
8 years ago

call-once-after-tick

Enables multiple call-sites to enqueue a function call that will occur both asynchronously and only once per tick.

Install

npm install --save call-once-after-tick

Example

import callOnceAfterTick from 'call-once-after-tick';

let count = 0;
const fn = callOnceAfterTick(() => count++);

console.log(count); // 0

fn();
fn();
fn();

console.log(count); // 0

process.nextTick(() => {
  console.log(count); // 1
});
1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago