Our today’s topic is a library for working with streams and events. It’s RxJS and it represents the idea of reactive programming. In the simple words, the meaning of this idea semantically is a representation of all operations as the stream, more specifically, as the sequence of events. Programmatically it means for our usage of two patterns: iterator (for establishing of the sequence itself and going through this one) and observer (for changes propagation).
From my experience many times customers asked me to install new environment for myself, help newbies to set the same environment. Another case was to upgrade software packages, e.g. Postgres 5.4 to 5.5. These tasks are not the complexity of ‘rocket science’ but if you are front-end developer it can take much of your time. The best is to give DevOps work to DevOps engineers.
Use when you want to select between different algorithms in the process of task resolving. So basically all that you need to realize this pattern are strategies (each of them in the separated component/class, but with the same interface) and strategy selector (decides what strategy is more effective at the moment and uses it).
The main idea is a creation of simplified interface to application functionality. Basically, when you create components of your application the interfaces of these ones can be really complicated for outside usage. So to resolve this problem and provide easy-to-go solution, you can use Façade.
In real life we generally have more than one template. Moreover, if we create a website with several pages, it usually happens that a number of them are of the same design. The template systems should consider this aspect. Unfortunately, ejs doesn’t deal very well with this task. That’s why we are going to install a different templating system named ejs-locals(let us add it to app.js):