Quick actions

cmd+k|ctrl+k

Navigation

Languages

Create a Redux action creator

Snippet info

Language

JavaScript

Visibility

public

Author

nvmarcosalex

Created

2018-10-04T19:56:52Z

Updated

2018-10-04T19:56:52Z

/* Create An Action Creator
 *
 * You need to create an action creator called 'mealCreator' that should:
 *   - Accept an id
 *   - Return a Redux action with a 'type' property that has a value of 'CREATE_MEAL'
 *   - Include the id passed to the action creator
*/

const mealCreator = id => ({
    type: 'CREATE_MEAL',
    id
})


console.log(mealCreator(1));
INFO