Promises Tutorials

  • By
    Promises and Static Values

    Async can throw a real wrench into the cogs of our programming workflows, all despite the fact that async is the modern JavaScript pattern. While async/await helps, there's sometimes confusion about the way to have a single function that returns a value whether it exists...

  • By
    then on Objects

    Promises were a revelation in JavaScript development, allowing us to enjoy async processing and avoid callback hell. Many new APIs like Battery API, Cache API, and others use the promise API. One fact you may not know is that you can add...

  • By
    JavaScript Proxy with Storage

    The JavaScript Proxy API provides a wealth of "magic" within JavaScript, allowing you to use any object as sort of an alias that allows a wall of validation, formatting, and error throwing. Did you know that you could also employ the Proxy API as...

  • By
    JavaScript Detect Async Function

    JavaScript async/await has changed the landscape of how we code. We're no longer stuck in callback or then hell, and our code can feel more "top down" again.Async functions require the following syntax:To use await with a function, the function needs to be declared with...

  • By
    Build a Decentralized Web Chat in 15 Minutes

    In this 15 minute tutorial we're going to build a simple decentralized chat application which runs entirely in a web browser.All you will need is a text editor, a web browser, and a basic knowledge of how to save HTML files and open them in the browser.

  • By
    Write Your First Service Worker in 5 Minutes

    What is a service worker?A service worker is a little file that will allow you to cache files and other assets on a user's machine. How is this different from server-side caching? Because the assets are stored on a user's machine, rather than a server...

  • By
    Background Sync with Service Workers

    Service workers have been having a moment. In March 2018, iOS Safari began including service workers -- so all major browsers at this point support offline options. And this is more important than ever -- 20% of adults in the United States are without Internet at...

  • By
    JavaScript waitForever

    Writing mochitests for new features in DevTools can be difficult and time-consuming.  There are so many elements interacting in an async manner that I oftentimes find myself using the debugger to debug the debugger!  In the case where it's unclear what interaction isn't working properly, I...

  • By
    The Dark Side of Promises

    Since the release of es6 many new features have found their way into NodeJS, but non had quite the same impact as promises. Promises have been developed for the browser before es6 was even a thing. There were several implementations that have been used like jQuery's...

  • By
    Six Tiny But Awesome ES7 + ES8 Features

    Development of new features for the core JavaScript language has really improved over the last five years, thanks in part to JavaScript frameworks pushing the limits and proving how important given functionality can be.  My previous ES6 posts, Six Tiny But Awesome ES6 Features and...