q_q

1.0.0 • Public • Published

task queue

First-in-first-out queue for async tasks fired in batches with requestAnimationFrame.

usage

basic usage

import queue from "q_q";
 
queue(function() {
    console.log("later");
});
 
console.log("now");
 
/*
    now
    later
 */

queueOnce will skip tasks already in queue

import { queueOnce } from "q_q";
 
function sayHi() {
    console.log("hi!");
}
 
for (let i = 0; i < 10; ++i) {
    queueOnce(sayHi);
}
/*
    hi!
 */

Readme

Keywords

Package Sidebar

Install

npm i q_q

Weekly Downloads

1

Version

1.0.0

License

ISC

Last publish

Collaborators

  • hadhadhadhadabettereffect