The Builder configuration pattern in React
Lately I’ve been doing a lot of work with React Native and I’ve been relying on the use of a lot of third-party npm modules to reliably get things done. As such I’ve seen two popular patterns for configuration, the builder pattern and the options object pattern. This article will focus on just exactly what the builder pattern is (as you may have guessed from the title) and there will be a follow-up article that dives into the options object pattern.
The builder pattern can often be used to simplify client code that creates complex and reusable view definitions and will often be popular/familiar with developers who like the concept of method chaining.
Builder’s are completely mutable right up to the point where the builders get built which scopes for the lazy-loading of properties or to inject properties as they are scoped.
const NewCar = new Car.Builder()
A builder being built…