The callback executed by setTimeout is not expected to return anything, it just ignores the returned value. The other day I needed to call a function that returns a Promise from within the callback function passed to JavaScript's setTimeout function. ![]() TypeScript is a nice language but sometimes you end up in the dark corners of JavaScript or the runtime. Is it safe to use async functions as callbacks in the JavaScript timer setTimeout and setInterval functions?Īt Atomist, our open source client libraries are written in TypeScript and run on Node.js, so I end up writing a lot of TypeScript. For up-to-date information, check out the Atomist product page. Since then, Atomist has evolved and updated its platform and product offerings. Editor's note: This post was originally published in November 2019.
0 Comments
Leave a Reply. |