2.0.0 • Published 4 years ago

@skarllet/queue v2.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
4 years ago

Queue

This module is destinated to queue events;

Install the module

Instalation

npm install @skarllet/queue

Usage

// To use the module inside Node JS
const queue = require('@skarllet/queue')

// Define a handler
const handler = item => {
  console.log(item)
}

// Create a queue instance and pass the handler to it
const q = queue.create(handler)

// push an event and its parameters that will passed down to the handler
q.push({ text: 'foo' })
q.push({ text: 'bar' })

// Start the execution
q.start()
// log: { text: 'foo' }
// log: { text: 'bar' }
2.0.0

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago