How to create a Redux store

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**

const reducer = (state = 5) => {
return state;
}
Redux.createStore = (state =5) => {
return state;
}

// Redux methods are available from a Redux object
// For example: Redux.createStore()
// Define the store here:
  **Your browser information:**

User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36

Challenge: Create a Redux Store

Link to the challenge:

createStore is a function that takes a reducer function as an argument and returns a store. The store is just an object with some functions attached to it, when you run one of those functions (dispatch) it runs the reducer function and updates the state of the store.

1 Like

so in essence the code snippets should look like?

Well, you’ve written the two things exactly the same. The reducer is fine, but you’ve written createStore exactly the same

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.