You can use the package object.assign . This is the ES6 Object.assign () "ponyfill".
package.json:
"dependencies": { "object-assign": "^1.0.0", "react": "^0.12.0", ... },
Then where you want to use it:
var assign = require('object-assign'); var MessageStore = assign({}, EventEmitter.prototype, { emitChange: function() { ...
Facebook Flux Chat uses it.
nilgun
source share