Skip to content

Instantly share code, notes, and snippets.

@dnshko
Created August 5, 2020 10:42
Show Gist options
  • Save dnshko/f6eaff0fac2b19c74eb9325131d0eefd to your computer and use it in GitHub Desktop.
Save dnshko/f6eaff0fac2b19c74eb9325131d0eefd to your computer and use it in GitHub Desktop.
Promise
// 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