Skip to content

Instantly share code, notes, and snippets.

@zoxon
Created April 12, 2021 08:08
function fakeRequest(data) {
// eslint-disable-next-line unicorn/consistent-function-scoping
const random = (min, max) => Math.floor(Math.random() * (max - min) + min)
return new Promise((resolve) => {
setTimeout(() => {
return resolve({ isOk: true, data })
}, random(500, 2000))
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment