Nuxt/test/fixtures/basic/composables/asyncDataTests.ts
pooya parsa 5a17458af5
fix(nuxt): use shared state for asyncData (#7055)
Co-authored-by: Ohb00 <43827372+OhB00@users.noreply.github.com>
2022-08-30 12:34:09 +02:00

8 lines
213 B
TypeScript

export const useSleep = () => useAsyncData('sleep', async () => {
await new Promise(resolve => setTimeout(resolve, 50))
return 'Slept!'
})
export const useCounter = () => useFetch('/api/useAsyncData/count')