How can we do async actions, such as calling a web service? This kind of call requires some different processing: you cannot just dispatch an action, if we are still waiting for the results of an Ajax call. The Redux thunk middleware lets you write an action creator that returns a function instead of an action; the function is given access to the store contents and to the dispatch function itself, and can then do async calls, dispatch other functions, and so on.
It seems that the origin of the thunk word comes from a very late programming session, in which, after many hours of work, a solution to a problem was found that had been thought before, and thunk became its name as a derivative of think, make of it what you will!
This sound a bit mysterious, so let's dive in and see how it works by doing a variation on the country/region components...