--- id: 5a24c314108439a4d403614f title: Dispatch an Action Event challengeType: 6 isRequired: false videoUrl: '' localeTitle: Отправка события --- ## Description undefined ## Instructions undefined ## Tests
```yml tests: - text: Вызов функции loginAction должен возвращать объект с свойством type установленным в строку LOGIN . testString: 'assert(loginAction().type === "LOGIN", "Calling the function loginAction should return an object with type property set to the string LOGIN.");' - text: Магазин должен быть инициализирован объектом с идентификатором login установленным в значение false . testString: 'assert(store.getState().login === false, "The store should be initialized with an object with property login set to false.");' - text: Метод store.dispatch() должен использоваться для отправки действия типа LOGIN . testString: 'getUserInput => assert((function() { let noWhiteSpace = getUserInput("index").replace(/\s/g,""); return noWhiteSpace.includes("store.dispatch(loginAction())") || noWhiteSpace.includes("store.dispatch({type: \"LOGIN\"})") === true })(), "The store.dispatch() method should be used to dispatch an action of type LOGIN.");' ```
## Challenge Seed
```jsx const store = Redux.createStore( (state = {login: false}) => state ); const loginAction = () => { return { type: 'LOGIN' } }; // Dispatch the action here: ```
## Solution
```js // solution required ```