1.0.0-alpha.12 • Published 2 years ago

@ngnjs/queue v1.0.0-alpha.12

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

The NGN Queue is a collection of functions, stored in the order they're added t othe collection. "Running" a queue executes these functions, in parallel or sequentially.

Documentation for this plugin does not exist yet, but the inline comments in the code are thorough. The unit tests provide use cases, and a series of live examples are available on codepen.

The fundamental/basic example:

import NGN from 'https://cdn.jsdelivr.net/npm/ngn@latest/index.js'
import Queue from 'https://cdn.jsdelivr.net/npm/@ngnjs/queue/index.js'

const tasks = new Queue()

tasks.add(function () {
  console.log('Run task 1')
})

tasks.add(next => {
  setTimeout(() => {
    console.log('Run async task.')
    next()
  }, 300)
})

tasks.add('t3', function () {
  console.log('Run task named ' + this.name)
})

tasks.on('end', function () {
  console.log('All Done!')
})

tasks.runSync()
1.0.0-alpha.12

2 years ago

1.0.0-alpha.11

3 years ago

1.0.0-alpha.10

4 years ago

1.0.0-alpha.9

4 years ago

1.0.0-alpha.7

4 years ago

1.0.0-alpha.8

4 years ago

1.0.0-alpha.6

4 years ago

1.0.0-alpha.5

4 years ago

1.0.0-alpha.4

4 years ago

1.0.0-alpha.3

4 years ago

1.0.0-alpha.2

4 years ago

1.0.0-alpha.1

4 years ago

1.0.0-alpha

4 years ago