Skip to content

Commit

Permalink
Use CommonJS until Babel ES3 transforms are fixed
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gaearon committed Dec 28, 2015
1 parent e5741af commit 00f7fdb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
export default function thunkMiddleware({ dispatch, getState }) {
function thunkMiddleware({ dispatch, getState }) {
return next => action =>
typeof action === 'function' ?
action(dispatch, getState) :
next(action);
}

module.exports = thunkMiddleware

0 comments on commit 00f7fdb

Please sign in to comment.