q_q
v1.0.0
Published
minimal first in first out task queue
Downloads
2
Maintainers
Readme
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!
*/