MethodQueue is a simple queueing system for methods for Javascript.
Install MethodQueue using NPM:
npm i methodqueue --save
Once installed, you can import it into your application using:
const Queue = require("methodqueue")Or if you use Typescript/Webpack:
import Queue from "methodqueue"There it is! Now, create a new method queue with:
let queue = new Queue([...methods])Dont modify these properties, you could break stuff.
An Array containg all queued methods.
queue._queuedMethodsThe current method index.
queue._processedMethodsCall next function with provided arguments.
queue.next({message: "Goodbye"})Call previous function with provided arguments.
queue.prev({message: "Hello"})Call specified function with provided arguments.
queue.jump(1, {message: "Jumpin' back 'n forth."})Add methods to queue.
queue.add([a => "hello" + a, b => b + "goodbye"])