Skip to content

PQueue has no on method #12

@jgusta

Description

@jgusta
const queue = new PQueue({
  concurrency: 10,
})

queue.on("next", async () => {console.log('next')})

throw the error:

error: Uncaught (in promise) TypeError: queue.on is not a function

The readme seems to have been taken from the node version. The on method exists on Node's EventEmitter, but in this Deno version, this has been swapped out for EventTarget which has no on method. This package should either bring in Node's EventEmitter (import { EventEmitter } from 'node:events';) or the README should be adjusted to use addEventListener instead of on.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions