Skip to content

Repository files navigation

NGN Queue

A plugin for NGN

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:

importNGNfrom'https://cdn.jsdelivr.net/npm/ngn@latest/index.js'importQueuefrom'https://cdn.jsdelivr.net/npm/@ngnjs/queue/index.js'consttasks=newQueue()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()

About

A queue plugin for NGN

Topics

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Contributors

Languages