javascript Returning a promise inside try/finally Today I learned a quirk of try/finally as it relates to handling of returned promises: My understanding is was that, in most cases, these are equivalent: // 1 const result = await somePromise; return result; // 2 return somePromise; // 3 return await somePromise; But in the case of a try/finally -
webrtc WebRTC with async/await Basic WebRTC connection setup can be confusing to understand, and there really is a lot going on that is black magic. Even so, just getting a single page connection going is confusing. I wanted to try writing some async/await code to test out browser compatibility and try different patterns,
software Simple Image Lazy Loading with Ghost I recently put up a post [https://blog.xdumaine.com/a-year-in-review-2015] that happened to contain a bunch of images, and realized that the initial experience was kind of crappy, due to loading all of them at once. There were really two things I could do to improve this: lazy load
javascript Using Webtask.io for Secure API Tokens Single Page Applications are awesome. One downside is that static SPAs often have to authenticate with some service or API in order to coordinate some communication, access some data, or connect to other users, and that connection has an inherent security risk: How do you connect to a secure service
software FizzBuzz Code Golf in JavaScript The FizzBuzz problem is defined as: > For the numbers 1 to 100, print "fizzbuzz" if the number is divisible by 3 and 5, "fizz" if it's only divisible by 3, "buzz" if it's only divisible by 5, and nothing