In Redux Store is the state object which holds the Application state. The current state can be accessed using store.getState()and any changes to the state can be performed by dispatching an action to the reducer.
In the previous posts, we saw how to create the store object using createStore and use it to initialize the application. Redux store also allows us to subscribe to events that update the store object. This can be useful to debug changes to the redux store.
In the createStore code of the previous example we will add a subscription to display changes to the state to the console as follows.
In the previous posts, we saw how to create the store object using createStore and use it to initialize the application. Redux store also allows us to subscribe to events that update the store object. This can be useful to debug changes to the redux store.
In the createStore code of the previous example we will add a subscription to display changes to the state to the console as follows.