Answer the question
In order to leave comments, you need to log in
Purpose of Redux\Flux architecture?
In the course of learning the react, a mess arose in my head, which does not allow me to move further. I used to have experience with Angular 1.x. React is a completely different approach to creating a SPA.
Everyone says that for a full-fledged SPA on React, you need to use some additional technologies, because React only gives us View.
The concept of angular is clear to me, something similar to MVC. Separately, there is a view in which you can write elementary logic, the main logic is performed in controllers.
In React, in fact, we can write any js code in the component class, write any functions, manipulate the view as we please. Why do we need Flux and how is it useful here? I read a lot of materials and lessons, but did not understand "what for" it is needed. Let's take an example of a regular TODO list. Can't I add, remove TODOs and draw a table using react? Why do I need complications like action->dispatcher->store? Enlighten me, I will be very grateful.
Answer the question
In order to leave comments, you need to log in
"Something similar to MVC", aha.
1. In its purest form, MVC is not well suited to the web.
2. Somehow it so happened that at a certain moment a fashion arose for the letters MVC, and the authors of many different schemes began to call them MVC.
You have logic in controllers, but just look at Wikipedia to make sure that it does not belong there in MVC https://ru.wikipedia.org/wiki/Model-View-Controller
But you can dig deeper: https: //habrahabr.ru/post/321050/
The difference on small projects may be practically invisible, the benefits may also not be visible, just overengineering. But the larger the project, the greater the role of abstraction and the division of the application into layers begin to play. And TODO-list can be done without a framework at all.
To separate business logic and presentation.
For small applications such as a training to-do list, the benefits of a state management library may not be obvious, but as the number of entities that need to be managed and that can affect various parts of the UI together and individually increases, the need for some kind of orderly solution increases.
There are really a lot of problems in redux, as for me :)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question