Skip to content

latest update causes all instances of add to return response | void #175

@vidarc

Description

@vidarc
import PQueue from 'p-queue'

const queue = new PQueue();

// has type Promise<string | void>
const result = queue.add(() => 'testing');

I would initially expect result to have type of Promise<string>. This commit 8184655 seems to have changed that behavior.

If I'm reading the types correctly, doing

queue.add(() => 'testing', { throwOnTimeout: true })

should bring back the old typing, but it doesn't.

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