swr icon indicating copy to clipboard operation
swr copied to clipboard

fix(types): export InfiniteKeyedMutator

Open LeoMcA opened this issue 4 months ago • 3 comments

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.

LeoMcA avatar Feb 21 '24 11:02 LeoMcA

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.

codesandbox-ci[bot] avatar Feb 21 '24 11:02 codesandbox-ci[bot]

Can we merge this?

agjs avatar Mar 16 '24 11:03 agjs

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

eifr avatar Apr 18 '24 07:04 eifr

I've changed the name to SWRInfiniteKeyedMutator for consistency

koba04 avatar May 11 '24 11:05 koba04