Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const someAsyncFunction = () => {
  2.   return new Promise((resolve, reject) => {
  3.     setTimeout(() => {
  4.       resolve({
  5.         param1: 1,
  6.         param2: 2,
  7.         param3: 3
  8.       }, 3000)
  9.     })
  10.   })
  11. }
  12.  
  13. const test = async () => {
  14.   const result = await someAsyncFunction()
  15.   // do some tests here
  16. }
  17. test()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement