--- id: 5a24c314108439a4d4036157 title: Write a Counter with Redux challengeType: 6 isRequired: false videoUrl: '' localeTitle: '' --- ## Description undefined ## Instructions undefined ## Tests
```yml tests: - text: يجب أن يقوم incAction منشئ الإجراء بإرجاع كائن تصرف type يساوي قيمة INCREMENT testString: 'assert(incAction().type ===INCREMENT, "The action creator incAction should return an action object with type equal to the value of INCREMENT");' - text: '' testString: 'assert(decAction().type === DECREMENT, "The action creator decAction should return an action object with type equal to the value of DECREMENT");' - text: '' testString: 'assert(store.getState() === 0, "The Redux store should initialize with a state of 0.");' - text: '' testString: 'assert((function() { const initialState = store.getState(); store.dispatch(incAction()); const incState = store.getState(); return initialState + 1 === incState })(), "Dispatching incAction on the Redux store should increment the state by 1.");' - text: '' testString: 'assert((function() { const initialState = store.getState(); store.dispatch(decAction()); const decState = store.getState(); return initialState - 1 === decState })(), "Dispatching decAction on the Redux store should decrement the state by 1.");' - text: '' testString: 'assert(typeof counterReducer === "function", "counterReducer should be a function");' ```
## Challenge Seed
```jsx const INCREMENT = null; // define a constant for increment action types const DECREMENT = null; // define a constant for decrement action types const counterReducer = null; // define the counter reducer which will increment or decrement the state based on the action it receives const incAction = null; // define an action creator for incrementing const decAction = null; // define an action creator for decrementing const store = null; // define the Redux store here, passing in your reducers ```
## Solution
```js // solution required ```