export default function thunkMiddleware({ dispatch, getState }) {
  return next => action =>
    typeof action === 'function' ?
      action(dispatch, getState) :
      next(action);
}

function thunkMiddleware({ dispatch, getState }) {
  return next => action =>
    typeof action === 'function' ?
      action(dispatch, getState) :
      next(action);
}

module.exports = thunkMiddleware

Use CommonJS until Babel ES3 transforms are fixed
Use CommonJS until Babel ES3 transforms are fixed

Our current presets didn't include ES3 transforms by default, so IE8 support is broken. Normally we would have fixed it by adding a few plugins:

* babel-plugin-transform-es3-member-expression-literals
* babel-plugin-transform-es3-property-literals

Unfortunately there is a [bug in Babel](https://phabricator.babeljs.io/T2817) that prevents them from working correctly in certain cases with `export default` declarations. Until this is resolved, we will go back to using CommonJS modules internally.
