khrj / khrj/p-queue

PQueue has no `on` method

Open
#12 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
22
Forks
5
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the README's queue.on example with the Deno implementation's EventTarget API. Decide whether the package should expose Node's EventEmitter or document addEventListener, then verify that the README example matches the supported API and works in Deno.

Written by the indexing model from the issue text.

Assessment

Tech stack
deno, typescript
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.