JavaScript's Object.freeze and TypeScript's Readonly
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.
TypeScript, JavaScript, React, React Native
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.
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.
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.
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.
I’ve recently started using exact versions in my package.json. This allows me to have more control over my versions and with tools like Renovate this is easier than ever.
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.
After using Redux on a handful of large applications, this is my understanding of how it should be used.
I like to reimplement libraries I use, this allows me to better understand how they work, below is my minimal implementation of Redux.
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.
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.
With the arrival of React 0.14 into React Native, we now have a third way of creating components in React Native, stateless components.
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.
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).