I\'m having a function returning a promise. In this function, we call a third party vender to send some push notification through their server.
it looks like
Create new promise which will call sendMessage after a timeout.
sendMessage
apiGetLoggedInUser.then( user => { return new Promise((resolve, reject) => { setTimeout(() => { sendMessage(user.name).then(resolve, reject); }, 3000) }); } )