Created
August 5, 2020 10:42
-
-
Save dnshko/f6eaff0fac2b19c74eb9325131d0eefd to your computer and use it in GitHub Desktop.
Promise
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
// First promise returns an array after a delay | |
const getUsers = () => { | |
return new Promise((resolve, reject) => { | |
return setTimeout( | |
() => resolve([{ id: 'jon' }, { id: 'andrey' }, { id: 'tania' }]), | |
600 | |
) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment