Skip to content

Instantly share code, notes, and snippets.

@zoxon
Created April 12, 2021 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoxon/f7baae305b30fade4e9f9b32a069f90a to your computer and use it in GitHub Desktop.
Save zoxon/f7baae305b30fade4e9f9b32a069f90a to your computer and use it in GitHub Desktop.
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