![]() Once the reducer has created the new state, it is saved in a data store. The reason for this is that it provides a predictable tree of state changes that can be used to debug an application, which is Redux’s primary benefit. It’s very essential to know that the state is immutable, meaning it can’t be changed directly it has to be copied over to a whole brand new state. Once an action has been dispatched then this action will be used by a reducer function which will copy the current state of the application along with any data changes to a new javascript object. The only way to change the state is by dispatching an action. Then the user performs an action that will change the state of the data in redux. So we have a user interface that is displaying some data. Let’s start by looking at the core principles of Redux. In this article, we are gonna cover the basics of Redux and then we’ll create an angular app from scratch using NgRx. Before getting to know NgRx we need to know about Redux, Redux is a design pattern that encapsulates all application data in a single javascript object, providing a consistent global data state at all times, this method is most used in react apps but it can also be applied to angular apps with a library called NgRx which uses Redux core principles with RxJs library under the hood. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |