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

Mismatch of type and arguments in fn.fetch in README #7

Open
iainsimmons opened this issue Mar 2, 2023 · 0 comments
Open

Mismatch of type and arguments in fn.fetch in README #7

iainsimmons opened this issue Mar 2, 2023 · 0 comments

Comments

@iainsimmons
Copy link

Describe the bug

The fn.fetch method returned from the fetch$ function, as described in the README says: "In this case, only the request object is passed as the first argument".

The type signature for the fn.fetch method in the README is as follows, which seems to match the description:

  fn.fetch(
    request: RequestInit,
  ) => Promise<
    Awaited<ReturnType<T>> extends JsonResponse<infer R>
      ? R
      : ReturnType<T>
  >

But the Arguments section beneath suggests it still takes a payload and an options: { request }, similar to the fn function.

I might be misunderstanding this, but it doesn't seem to match.

Your Example Website or App

https://github.com/TanStack/bling#returns

Steps to Reproduce the Bug or Issue

  1. Go to https://github.com/TanStack/bling#returns
  2. See the fn.fetch return method

Expected behavior

As a developer reading the documentation, I expect the arguments to reflect those shown in the types.

Screenshots or Videos

No response

Platform

N/A

Additional context

No response

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