Skip to content

Instantly share code, notes, and snippets.

@javarouka
Created May 14, 2017 16:23
Show Gist options
  • Save javarouka/01ddc00cad091eba3575969f50f606b2 to your computer and use it in GitHub Desktop.
Save javarouka/01ddc00cad091eba3575969f50f606b2 to your computer and use it in GitHub Desktop.
play promise post example
function executeBeforeTimeout(thenable, millis) {
return Promise.race([
Promise.resolve(thenable), // 혹시 thenable 하지 않더라도, 명시적으로 Promise 로 변경해준다.
timeBomb(millis) // 위에 정의한 지연폭탄
]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment