Online and Offline Events with JavaScript
Let's say we want to display a message to our users when they're offline. Unfortunately, navigator.onLine is considered an unreliable API.
My ramblings on programming, product development, and more, collected in chronological order.
Let's say we want to display a message to our users when they're offline. Unfortunately, navigator.onLine is considered an unreliable API.
It took more than 25 years for the first three billion people to come online, but over the next decade that number is expected to double. It's with these people and problems in mind that developers have begun shifting towards an offline first approach for websites and applications.
Snapshot testing is a form of regression testing that verifies that your UI does not change unexpectedly.
Writing asynchronous code in JavaScript has traditionally been a pretty messy endeavor. It usually meant writing callbacks on top of callbacks, handling errors multiple levels deep, resulting in the infamous pyramid of doom.
React 16 has entered the beta phase and with it comes with two of my favorite additions in a long time: returning arrays in the render() method and official support for error boundaries.
React testing (and JS testing, in general) is an incredibly broad topic with a lot of nuance. In this post, I primarily want to focus on exploring some of the basic what's and why's of, as well as a few best practices for, testing React applications.