JSPM

data-queue

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 132
  • Score
    100M100P100Q69292F
  • License MIT

Queue and get data

Package Exports

  • data-queue

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (data-queue) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

data-queue

Queue and get data

Usage

const Queue = require("data-queue")

const queue = Queue() //create without new

queue.get((err, data) => { //this will wait for .append()/.prepend() or .error() calls
  console.log(data)
  queue.get((err, data) => {
    if (err) throw err //Throw the error
  })
})

queue.append("Hi there")

queue.error(new Error("Something fatal happened"))

queue.append("What's up?") //This won't append the data. instead it will return the error