Skip to content

TypeScript support #2

Open
Open
@wojtekmaj

Description

@wojtekmaj

Hey,
just wanted to share these typings I created:

declare module 'fetch-throttle' {
  function throttledFetch(
    input: RequestInfo | URL,
    init?: RequestInit
  ): Promise<Response>;

  const throttle = (fetch: fetch, calls: number, milliseconds: number) =>
    throttledFetch;

  export default throttle;
}

feel free to add it to your repo & ship if you feel like it, to make it easier for TypeScript users to use the library.

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