Last active
October 1, 2021 13:40
-
-
Save oaugusto256/9db0cf70bd4de86861e79cb5c4b5eaf2 to your computer and use it in GitHub Desktop.
Mock HTTP requests at JavaScript
This file contains 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
// Mock HTTP requests | |
import { users, departaments } from '../mock'; | |
export const getUsers = async () => { | |
return new Promise(resolve => setTimeout(() => { | |
resolve(users); | |
}, 2000)); | |
}; | |
// https://dev.to/nordicbeaver/a-real-life-example-of-making-a-custom-promise-in-javascript-typesctipt-5d1n |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment