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

fix(infinte): export SWRInfiniteKeyedMutator type #2900

Merged
merged 3 commits into from
May 11, 2024

Conversation

LeoMcA
Copy link
Contributor

@LeoMcA LeoMcA commented Feb 21, 2024

https://github.com/vercel/swr/pull/2862/files added a new InfiniteKeyedMutator type, but didn't export it, which meant we had to use a rather roundabout fix:

// "swr/infinite" doesn't export InfiniteKeyedMutator directly
type InfiniteKeyedMutator<T> = SWRInfiniteResponse<
  T extends (infer I)[] ? I : T
>["mutate"];

It would be great if we could export this type directly, like KeyedMutator is.

Copy link

codesandbox-ci bot commented Feb 21, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@agjs
Copy link

agjs commented Mar 16, 2024

Can we merge this?

@eifr
Copy link

eifr commented Apr 18, 2024

any updates regarding this one? im unable to upgrade atm as im using KeyedMutator as prop

Copy link
Collaborator

@koba04 koba04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@koba04 koba04 changed the title fix(types): export InfiniteKeyedMutator fix(types): export SWRInfiniteKeyedMutator May 11, 2024
@koba04 koba04 changed the title fix(types): export SWRInfiniteKeyedMutator fix(infinte): export SWRInfiniteKeyedMutator type May 11, 2024
@koba04
Copy link
Collaborator

koba04 commented May 11, 2024

I've changed the name to SWRInfiniteKeyedMutator for consistency

@koba04 koba04 merged commit cb2946d into vercel:main May 11, 2024
7 checks passed
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

Successfully merging this pull request may close these issues.

4 participants