DEV Community

Naveen Dinushka
Naveen Dinushka

Posted on

How to create a basic redux store? (Freecodecamp notes)

Lets answer some basic questions

1) What is Redux?
Redux is a state management framework that can be used with number of different technologies, including React. Note that Redux can be used with different technologies and not only React, it is just popular for being used with React.

2) What is a Redux store?
Redux store is the single source of truth when it comes to application state , if we had 3 components in an app and with 3 different states , the entire state of your app would be defined by a single state object housed in the Redux store. This also means that any time a piece of your app wants to update , it must do so through the redux store . This makes it easier to track the state of your app.

3) What are some important functions and keywords we will need to know before we create a redux store?

  • Redux store is an object which holds and manages application state
  • createStore() on Redux object is used to create a store
  • createStore takes in reducer function as a required argument
  • We can use .

4) Declare a variable and assign it to the createStore() method passing in the reducer as an argument

5) How can we retrieve the state from a redux store?

Knowledge check

1) What is Redux?
2) What is a Redux store?
3) What are some important functions and keywords we will need to know before we create a redux store?
4) How to declare a variable and assign it to the createStore() method passing in the reducer as an argument
5) How can we retrieve the state from a redux store?

NOTE: These are notes from FreeCodeCamp https://www.freecodecamp.org/learn/front-end-development-libraries/redux

Top comments (0)