createAction() Example
Let’s have a look at an example using the createAction function.
We'll cover the following...
Here’s a complete example using the createAction()
function:
const addRecipe = createAction(
ADD_RECIPE,
(title, description ) => (...args),
{ silent: true }
);
const addRecipeAsync = (title, description = '') => {
const details = { ...args };
return (dispatch) => {
...