JavaScript's Object.freeze and TypeScript's Readonly

JavaScript's Object.freeze and TypeScript's Readonly

Published

Do you want static or runtime immutability, or both? In this article I will show you how to combine Object.freeze with Readonly to get the best of both worlds.

The Most Convoluted JavaScript Fizz Buzz Solution

The Most Convoluted JavaScript Fizz Buzz Solution

Published

Finding the correct level of decomposition is sometimes challenging. In this article, I will take decomposition to the extreme creating a wildly convoluted Fizz Buzz solution and share my feelings on the correct level of decomposition.

JavaScript Named Parameters

JavaScript Named Parameters

Published

I find JavaScript’s lack of named parameters frustrating. In this article, I will show you how you can get the same effect and as a bonus, show you how to achieve default values.

JavaScript Async/Await Promise All Array Destructuring

JavaScript Async/Await Promise All Array Destructuring

Published

I think you will agree with me when I say working with asynchronous code is an important part of modern app development. Using new JavaScript syntax you can drastically improve the readability and performance of your code. In this article, I will show you how to use Promise.all() along with array destructuring.

How to save exact npm package versions
JavaScript ES8 Object.entries/values

JavaScript ES8 Object.entries/values

Published

JavaScript is advancing at a rapid pace. In this article, I will give a brief overview of the new Object static methods. ES8 (a.k.a 2017) now has Object.values and Object.entries to accompany Object.keys.

Understanding Redux

Understanding Redux

Published

After using Redux on a handful of large applications, this is my understanding of how it should be used.

Redux reimplemented in 12 lines of code

Redux reimplemented in 12 lines of code

Published

I like to reimplement libraries I use, this allows me to better understand how they work, below is my minimal implementation of Redux.

Class properties with React

Class properties with React

Published

Dealing with this binding in JavaScript can be a real pain. In this article, I will show you three ways to avoid binding issues. Class Properties is the new JavaScript syntax for creating handler functions that have the correct this binding.

Async/Await with React Lifecycle methods

Async/Await with React Lifecycle methods

Published

If you are like me you will also end up doing a lot of asynchronous work in componentWillMount/componentDidMount. This article will show you how to use Async/Await with React’s Lifecycle events. React’s lifecycle methods can return any value, including a promise.

Stateless components in React Native

Stateless components in React Native

Published

With the arrival of React 0.14 into React Native, we now have a third way of creating components in React Native, stateless components.

Error first pattern for JavaScript Async/Await

Error first pattern for JavaScript Async/Await

Published

Dealing with errors is not fun. In this article, I will show you a pattern for dealing with errors in Async/Await. This pattern avoids the use of try/catch.

ES7 Async/Await with React Native

ES7 Async/Await with React Native

Published

Async/Await is a new syntax for writing asynchronous code in JavaScript. Support was added in React Native 0.10 and it’s now reached TC39 stage 3 (candidate).