What am I doing wrong? I’m getting an error: Uncaught TypeError: You provided an invalid object where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.
I’m using the deploy site (https://deploy-preview-80–freecodecamp-learn.netlify.com/front-end-libraries/react-and-redux/extract-state-logic-to-redux) since the beta site is broken, but I think the deploy site is broken, too.
const ADD = 'ADD';
function addMessage(msg){
return {
type: ADD,
message: msg
};
};
const messageReducer = (state = [], action) => {
switch(action.type){
case ADD: return [...state, action.message],
default: return state
};
};
const store = Redux.createStore(messageReducer);
//optionally store.dispatch(addMessage())