Nuxt/test/fixtures/basic/composables/asyncDataTests.ts

8 lines
213 B
TypeScript
Raw Normal View History

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