Handle an Action in the Store - loginAction()

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/

I’m not super familiar with Redux but it looks to me like whoever wrote the challenge forgot the store.dispatch(loginAction()) in the Challenge Seed (what you see in the code editor). It is being called in the test, it’s just not in the editor code. I feel like it was supposed to be carried over from the previous challenge Dispatch an Action Event.