Today, we’re going to do more complicated things. We will go away from the manual description of “closure,” subscriptions, and so on. All these things are, of course, not for manual maintenance. We will learn how to do these things easily and gracefully.
Let us continue our conversation about React infrastructure. But first, let us change our structure a little bit and move our Article component to a separate directory Article. So, let us create it. Change our component’s name to Index.js and add the following code:
As we saw in the previous article, decorators are just the Higher-Order components that add extra functionality to the passed component and return a new enhanced component. Before we get to our homework, let's dive deep and understand how decorators and mixins work.
Hey all! So, we continue working on our app. We already know how to make simple calls to the server and for 80% of possible cases this knowledge will be enough for executing standard tasks. However, we will learn how to deal with more complicated things, too. So, before moving on toward this task, I’d like to warn you that middleware does not necessarily need to be written by yourself. It means these are such frequently used (re-used) elements that have already been written previously by someone else. We recommend you to explore this resource, where you will find a whole bunch of various middlewares and so on. For example, here is a ready-to-use logger. We’ve created a logger to practice a little bit, but here is an example of a perfect ready-to-use solution.