How and what does app.js consist of? It is made in a way that from the very beginning we create a domain and then launch our app within this domain. Here all modules can be connected, a server gets created, etc. But why do we connect modules here? The reason is that some other modules can be added when the connection happens, and they can connect others, too.
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.
Hey all! Right now we will check up your home task and give you some valuable comments that will help you with your future work with React. To make it more convenient, you will need to see your code, so, switch to the respective commit and we will continue. Let us start with connect. We need connect to work with store. There is also another way: if you can transmit data using common props – do it! For example, in containers/Articles.js we refer to store in order to take out the needed articles from state:
So, let us now explore how we work with the data. We’ve used a denormalized structure for displaying our articles so far. You can see it in the file fixtures.js. Every article contains information about it, it really resembles a tree-like structure. This kind of structure is readable, but it will turn your life into hell, if you start to change the data.