Store

As described initially, the store is the main object that holds the application state tree. It's important to note that there will be a single store in a Redux application. When there is a requirement of splitting the data handling logic, you'll use the Reducer Composition pattern instead of creating many stores.

The following methods are available for Store:

  • getState(): Gives the current state tree of the application
  • dispatch(action): Used to dispatch an action
  • subscribe(listener): Subscribe to the store changes
  • replaceReducer(nextReducer): It is an advanced API that replaces the currently used Reducer by Store
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset