1
0
mirror of https://github.com/nuxt/nuxt.git synced 2025-03-01 22:13:28 +00:00
Nuxt/test/fixtures/basic/composables/asyncDataTests.ts
pooya parsa 5a17458af5
fix(nuxt): use shared state for asyncData ()
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')