Created
April 12, 2021 08:08
-
-
Save zoxon/f7baae305b30fade4e9f9b32a069f90a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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