1.1.2 • Published 12 months ago

small-queue v1.1.2

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

NPM version

Simple queue manipulation tool.

Demo

import { Queue } from 'small-queue';

const q = new Queue();

q.add((next) => {
  console.log(1);
  setTimeout(() => {
    next();
  })
})

q.add((next) => {
  console.log(2);
})

// Wait for the current queue to finish executing
q.awaitFinish().then(() => {
  console.log(4);

  // Restart
  q.add((next) => {
    console.log(1);
    next();
  })
})

CDN

<!DOCTYPE html>
<html lang="en">
<body>
  <script src="https://unpkg.com/small-queue/dist/queue.umd.js"></script>
  <script>
    const { Queue } = window.SQ;
    const q = new Queue();

    // ...
  </script>
</body>
</html>
1.1.2

12 months ago

1.1.1

12 months ago

1.1.0

12 months ago

1.0.1

1 year ago

1.0.0

1 year ago