Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

typescript promise

new Promise<boolean>((res, rej) => {
  res(true);
})
.then(res => {
  console.log(res);
  return false;
})
  .then(res => {
  console.log(res);
  return true;
})
  .then(res => {
  console.log(res);
})
  .catch(error => {
  console.log('ERROR:', error.message);
});
Source by blog.bitsrc.io #
 
PREVIOUS NEXT
Tagged: #typescript #promise
ADD COMMENT
Topic
Name
6+2 =