Skip to content

Adding a signal to all fetch requests #2567

@penx

Description

@penx

Description

createClient has an option to pass a signal:

const client = createClient<paths>({
  baseUrl,
  signal: AbortSignal.timeout(18000)
});

However, I think passing AbortSignal.timeout to this creates a timeout from the point of calling createClient rather than at the point of each request.

Proposal

Should the signal option of createClient accept a function that returns a signal, so that it can be recreated for each request?

Extra

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestopenapi-fetchRelevant to the openapi-fetch library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions