Tell us what’s happening:
Sure the code passed I get it the code passed but i want to understand how the reducer is accessing an arrow function that has been called after it cause that makes no sense to me
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
}
}
else{
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/134.0.0.0 Safari/537.36
Challenge Information:
Redux - Handle an Action in the Store