Explain store in redux?

Posted On: Feb 22, 2018

 

Redux is a state container for the applications on JavaScript that are often known as Redux Store. The store contains the entire state of the app in an unassailable object tree. createStore (reducer, [initial state], [enhancer]) is used to produce a new store. It requires the following three arguments to create a store. They are:

  • Reducer: It is a reducing function
  • InitialState: This is the initial state of the store
  • Enhancer: It is used to add libraries that are third party and middleware for persistent storage, logging and also enhances the Redux Store.

The Redux Store API is small in size and contains four methods like store.getState(), store.dispatch(action), store.subscribe(listener), and Store. replaceReducer(nextReducer).

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Redux interview questions

    What is Redux?

    Redux is a high-level tool that is implemented by the developers for easy and simple coding. Redux manages the state of the React applications. Redux helps and improves the elements where Reacts do no...

    Redux interview questions

    Redux is used where?

    Redux can be used in any view library like Vue.js, Angular JS, Ember, Backbone.js, Meteor, and Polymer. Redux with React is the most common combination. In Redux, the same state and action are carried...

    Redux interview questions

    What are reducers in Redux?

    A reducer in Redux is a function that determines the changes that are done to the state of an application. It implies the action it receives to determine his kind of changes. Redux relies heavily on t...