 (functions) to be dispatched.
 * If it's a thunk, it is called with `dispatch` and `getState`,
 * allowing the action to create multiple actions (most likely
 * asynchronously).
 */
function thunk({ dispatch, getState }) {
  return next => action => {
    return typeof action === "function"
      ? action(dispatch, getState)
      : next(action);
  };
}
exports.thunk = thunk;
PK