composition-api
composition-api copied to clipboard
feat: able to configure fetchKey with `useFetch` hook
đ Your use case
I have several components which are using fetch hook, and these components may use over 100 times in total on a page. I need to add fetchKey for them so Nuxt can get the correct value. I want to reuse the data in setup hook to generate the fetchKey.
đ The solution you'd like Describe what you want to happen.
// this
useFetch(() => {...}, { key: 'foo' })
// and this
useFetch(() => {...}, { key: (getCounter) => `foo:${getCounter('foo')}` })
đ Alternatives you've considered Have you considered any alternative solutions or features?
âšī¸ Additional info Is there any other context you think would be helpful to know?