For example There are many forms on the website with the option to save data we need to save the state of the completed form somewhere to return to it later or we simply want to save a specific application state immediately after user interactions What is worth knowing before deciding on NgRx? Please remember that the entry threshold is quite high because in addition to knowing the library and its architecture you must strictly follow certain code writing conventions and know RxJS at a quite high level. Ultimately however the benefits of using NgRx will outweigh the benefits.
The amount of work is also important because while when writing ordinary services necessary for the application we will write the code very quickly when using NgRx it will take several times longer due to its architecture. And yet we also have to write unit tests. It seems quite complicated to start with right? So let's see what this architecture looks Email Marketing List like from the inside. Redux Architecture The Redux architecture is characterized by the fact that everything that happens in the application is very predictable. This is because we have a oneway data flow which forces us to follow certain conventions and strictly define when the application state is to be changed.
Thanks to this it protects the application against unwanted state changes. One of the main principles of Redux is to have one global application state that is immutable and stored in a store object also sometimes called single source of truth SSOT. Changes to the store's stock can only happen by dispatching actions to our store and we should never do it directly. How it's working? Starting from the view layer itself during user interaction a method called dispatch is called to which an action object is passed as parameters.