Redux Store
Let's learn about the Redux store.
We'll cover the following...
Introduction to the store
The Redux store is a central, immutable data container that holds all the information about an application’s state. The store is nothing but a simple JavaScript object.
let store = {name: 'John Doe',email: 'john@doe.com',books: [{title: 'The Clean Code',price: 35.55},{title: 'The 80/20 Principle',price: 45.59}]}console.log(store)
In Angular applications, we use services to share the same piece of data across multiple components. Our components subscribe to the required services and get notifications when the data gets modified. The components then get updated accordingly.
The main drawback of this approach is that we need to create a lot of services. In a large application, it often gets challenging to maintain all of these services effectively.
Redux provides an effective solution to this problem. In Redux, we keep all of our states in a single store. Instead of subscribing to multiple services, all our ...