deno.land / x / jotai@v1.8.4 / tests / query / fakeFetch.ts

نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
async function fakeFetch<Response>( response: Response, error = false, time = 0): Promise<{ response: Response }> { await new Promise((r) => setTimeout(r, time)) if (error) { throw new Error('fetch error') } return { response }}
export default fakeFetch
jotai

Version Info

Tagged at
a year ago