Skip to content

itsacorn/methodqueue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MethodQueue

MethodQueue is a simple queueing system for methods for Javascript.

NPM

Basic Usage

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])

Properties

Dont modify these properties, you could break stuff.

._queuedMethods

An Array containg all queued methods.

queue._queuedMethods

._processedMethods

The current method index.

queue._processedMethods

Methods

.next(...args)

Call next function with provided arguments.

queue.next({message: "Goodbye"})

.prev(...args)

Call previous function with provided arguments.

queue.prev({message: "Hello"})

.jump(index, ...args)

Call specified function with provided arguments.

queue.jump(1, {message: "Jumpin' back 'n forth."})

.add(methods)

Add methods to queue.

queue.add([a => "hello" + a, b => b + "goodbye"])

About

A simple queueing system for methods in JS.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published