Series: JavaScript design patterns

JavaScript

JavaScript design patterns #1. Singleton and the Module

This entry is part 1 of 3 in the JavaScript design patterns

While having a vibe of a mad genius might be tempting, reinventing the wheel is usually not the best way to approach designing your software. The chances are that somebody already had the same problem as you and solved it in a smart way. Such best practices, when formalized, are called design patterns. Today we look into […]

JavaScript

JavaScript design patterns #2. Factories and their implementation in TypeScript

This entry is part 2 of 3 in the JavaScript design patterns

As discussed in the previous part of this series, there are many design patterns out there. Some of them fit well into the JavaScript language, and they are often used. In this article, we discuss the factory method pattern and show some of its use-cases. We also implement it in TypeScript. There seems to some confusion regarding […]

JavaScript React

JavaScript design patterns #3. The Facade pattern and applying it to React Hooks

This entry is part 3 of 3 in the JavaScript design patterns

The essential thing when approaching design patterns is to utilize them in a way that improves our codebase. The above means that we sometimes can bend them to fit our needs. The Facade design pattern is commonly associated with object-oriented programming. That doesn’t change the fact that we can take its fundamentals and apply them […]