Tell us what’s happening:
I just found out that this challenge passes with the last line leaving it null, where obviously it should use Redux.createStore()
const store = null;
Am I missing something or is it a wrong past test declaration?
Your code so far
const INCREMENT = 'INCREMENT'; // Define a constant for increment action types
const DECREMENT = 'DECREMENT'; // Define a constant for decrement action types
const counterReducer = (state = 0, action) => {
switch(action.type) {
case INCREMENT:
return state + 1
case DECREMENT:
return state - 1
default:
return state
}
}; // Define the counter reducer which will increment or decrement the state based on the action it receives
const incAction = () => {
return {
type: INCREMENT
}
}; // Define an action creator for incrementing
const decAction = () => {
return {
type: DECREMENT
}
}; // Define an action creator for decrementing
const store = null; // Define the Redux store here, passing in your reducers
Your browser information:
User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36
Challenge: Redux - Write a Counter with Redux
Link to the challenge: