Skip to content

Instantly share code, notes, and snippets.

@reddyonrails
Forked from sebmarkbage/es6mixin.js
Created July 13, 2018 16:46
Show Gist options
  • Select an option

  • Save reddyonrails/aa15ed29ed7e1a28deedd72c29556f19 to your computer and use it in GitHub Desktop.

Select an option

Save reddyonrails/aa15ed29ed7e1a28deedd72c29556f19 to your computer and use it in GitHub Desktop.
Mixin
var Bar1 = function (base) {
return class extends base {
componentWillMount(){
super();
console.log('Bar1');
}
};
};
var Bar2 = function (base) {
return class extends base {
componentWillMount(){
super();
console.log('Bar2');
}
};
};
class Foo extends mixins(Bar1, Bar2) {
componentWillMount() {
super();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment