Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow customization of what is sent to fetch function #23

Open
2 tasks
stazz opened this issue Sep 1, 2023 · 1 comment
Open
2 tasks

Allow customization of what is sent to fetch function #23

stazz opened this issue Sep 1, 2023 · 1 comment
Assignees

Comments

@stazz
Copy link
Member

stazz commented Sep 1, 2023

The following properties should be added to HTTPEndpointCallerOptions:

  • resourceInit?: (args: FetchCustomizationParameters) => URL | Request
  • requestInit?: RequestInitCustomization | ((args: FetchCustomizationParametrs<URL | Request>) => RequestInitCustomization)
export interface FetchCustomizationParameters<TResource = URL> {
  resource: TResource;
  method: data.HttpMethod;
  body: string | undefined;
  headers: Record<string, data.HeaderValue> | undefined;
}

export type RequestInitCustomization = Omit<RequestInit, "method" | "body" | "headers">;
@stazz stazz self-assigned this Sep 1, 2023
@stazz
Copy link
Member Author

stazz commented Sep 1, 2023

Notice that this also makes this package unusuable for consumer which don't have DOM as lib, or augmented global namespace with fetch-related things. Therefore, this issue should be done for next major release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant