Let’s say you are working on a project about article writing and now you are about to write actions to create and update articles.
To create an article, you would need an action creator like this.

When it comes to article updating, you need another action creator.

These two functions looks like each other very much.
Tasks like these are tedious and you may wonder if there is a way to get rid of these repetitive jobs.

Of course yes, but you need some extra help.
I highly recommend you to read the wiki page of functional programming if it’s new to you.
Otherwise the following snippets may be very strange to you.

To do functional programming, you may need some help of libraries such as Ramda.

With the above snippet, basically you are defining a function called actionArg that would return another function.
The function returned by actionArg would return an object describing the action you are creating.
At the last line you are making an action to deal with all the article related stuff.

Here comes the magic.
Now, to create an article, you just need to define an one line function.

Also it becomes easier if you want to update the title of an existing article.

This may not seem to be useful when you are only dealing with simple actions.
However when actions become complex, you can save a lot of time by writing actions in this way.