Shareable custom useAsyncData composable
I have a composable that fetches data with
If I understand correctly, useAsyncData should memoize it's value. So, I expected that the fetching data inside
Am I missing something here? I understand that I could get the cached value with
I have a Codesandbox with a POC here to show what I'm exactly trying to do
useAsyncData . I would like to reuse this composable in other components. So that would look something like this: If I understand correctly, useAsyncData should memoize it's value. So, I expected that the fetching data inside
useAsyncData would only be called once. However, this doesn't seem to be the case and the fetching data gets called twice. Am I missing something here? I understand that I could get the cached value with
useNuxtData inside the second component. But Ideally I would have one composable that's smart enough to either fetch the data or retrieve it from the cache. I have a Codesandbox with a POC here to show what I'm exactly trying to do