--- id: 5a24c314108439a4d4036146 title: Map Dispatch to Props challengeType: 6 isRequired: false videoUrl: '' localeTitle: '' --- ## Description undefined ## Instructions undefined ## Tests
```yml tests: - text: '' testString: 'assert((function() { const addMessageTest = addMessage(); return ( addMessageTest.hasOwnProperty("type") && addMessageTest.hasOwnProperty("message")); })(), "addMessage should return an object with keys type and message.");' - text: '' testString: 'assert(typeof mapDispatchToProps === "function", "mapDispatchToProps should be a function.");' - text: يجب أن ترجع mapDispatchToProps كائن. testString: 'assert(typeof mapDispatchToProps() === "object", "mapDispatchToProps should return an object.");' - text: '' testString: 'assert((function() { let testAction; const dispatch = (fn) => { testAction = fn; }; let dispatchFn = mapDispatchToProps(dispatch); dispatchFn.submitNewMessage("__TEST__MESSAGE__"); return (testAction.type === "ADD" && testAction.message === "__TEST__MESSAGE__"); })(), "Dispatching addMessage with submitNewMessage from mapDispatchToProps should return a message to the dispatch function.");' ```
## Challenge Seed
```jsx const addMessage = (message) => { return { type: 'ADD', message: message } }; // change code below this line ```
## Solution
```js // solution required ```