Send Action Data to Store
I am stuck on this problem for a long time. I think my code is correct , but somehow it is not passing all the tests. I am sharing my code . Can any body help me find the issue please
Link to the problem
const ADD_NOTE = 'ADD_NOTE';
const notesReducer = (state = 'Initial State', action) => {
switch(action.type) {
// Change code below this line
case ADD_NOTE : return { text: action.text}
// Change code above this line
default:
return state;
}
};
const addNoteText = (note) => {
// Change code below this line
return {
type : ADD_NOTE,
text : note
}
// Change code above this line
};
const store = Redux.createStore(notesReducer);
console.log(store.getState());
store.dispatch(addNoteText('Hello!'));
console.log(store.getState());