Skip to content

Commit f7f4258

Browse files
author
Alexandr Kozhevnikov
committed
example delay
1 parent 2faa3e2 commit f7f4258

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

example/components/RemoteDataSetExample.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ export const RemoteDataSetExample = memo(() => {
1515
return
1616
}
1717
setLoading(true)
18-
const response = await fetch('https://jsonplaceholder.typicode.com/posts')
18+
const response = await fetch('https://jsonplaceholder.typicode.com/posts').then((data) => new Promise(res => {
19+
setTimeout(() => res(data), 2000) // imitate of a long response
20+
}))
1921
const items = await response.json()
2022

2123
const suggestions = items

0 commit comments

Comments
 (0)