I’m trying to learn this library through a minimal build from scratch and can’t figure out why the below returns undefined on the second log statement (first log returns 1 as expected). What am I neglecting here? This is the script in its entirety.
const createStore = require('redux').createStore;
const reducer = (prior_state = { key : 'value' }, action) => {
switch (action.type) {
case "1":
console.log('1');
break;
default:
return prior_state;
}
};
const store = createStore(reducer);
store.dispatch({
type: '1',
});
console.log(store.getState());