angus-c / es6-react-mixins

universal mixin adapter for react

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Object.assign in lib/mixin.js

tomatau opened this issue · comments

The built lib/mixin file includes a call to Object.assign which isn't available on most browsers. I thought babel provided a polyfill automatically for this - but it's definitely in your lib code.

var noop = function noop() {};
var es6ify = function es6ify(mixin) {
  if (typeof mixin === 'function') {
    // mixin is already es6 style
    return mixin;
  }
  return function (Base) {
  // ...
    })(Base);

    Object.assign(NewClass.prototype, mixin);
    return NewClass;
  };
};

May need to build with this? https://github.com/JedWatson/babel-plugin-object-assign/blob/master/index.js

thanks for catching this @tomatau
fixed by compiling with runtime option