Skip to content

Release 4.0.0-beta.3

Pre-release
Pre-release
Compare
Choose a tag to compare
@tr3v3r tr3v3r released this 05 Apr 20:35
· 52 commits to main since this release

4.0.0-beta.3 (2024-04-05)

Breaking:

  • add initQueue and addQueueTask to Printer class

Changes here

So now, to use your queue engine, or remove it completely, you can extend from the Printer class and override two methods:
initQueue and addQueueTask

For instance, with this code, the p-queue won't be bundled.

class CustomQueuPrinter extends Printer {
  initQueue() {} // keep init clear
  addQueueTask<T>(task: () => Promise<T>) {  noop function
    return task(); //
  } 
}

Or you can implement these two methods with your engine:

class CustomQueuPrinter extends Printer {
  initQueue() {
    this.queue = new CustomQueue()
  }
  addQueueTask<T>(task: () => Promise<T>) {  
    return  this.queue.push(task) // or any other logic you need
  } 
}

Fixes

  • add all printer constants to be possible to import from the lib