--- id: 5a24c314108439a4d403614e title: Define an Action Creator challengeType: 6 isRequired: false --- ## Description
After creating an action, the next step is sending the action to the Redux store so it can update its state. In Redux, you define action creators to accomplish this. An action creator is simply a JavaScript function that returns an action. In other words, action creators create objects that represent action events.
## Instructions
Define a function named actionCreator() that returns the action object when called.
## Tests
```yml tests: - text: The function actionCreator should exist. testString: assert(typeof actionCreator === 'function'); - text: Running the actionCreator function should return the action object. testString: assert(typeof action === 'object'); - text: The returned action should have a key property type with value LOGIN. testString: assert(action.type === 'LOGIN'); ```
## Challenge Seed
```jsx const action = { type: 'LOGIN' } // Define an action creator here: ```
## Solution
```js const action = { type: 'LOGIN' } // Define an action creator here: const actionCreator = () => { return action; }; ```