Tell us what’s happening:
How is the variable const loginAction() connected to the rest of the code?
Your code so far
const defaultState = {
login: false
};
const reducer = (state = defaultState, action) => {
// change code below this line
if (action.type == 'LOGIN') return {login: true}
return state // change code above this line
};
const store = Redux.createStore(reducer);
const loginAction = () => {
return {
type: 'LOGIN'
}
};
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/front-end-libraries/redux/handle-an-action-in-the-store/