mirror of
https://github.com/flarum/framework.git
synced 2024-11-25 09:41:49 +08:00
12 lines
275 B
JavaScript
12 lines
275 B
JavaScript
export default function mixin(Parent, ...mixins) {
|
|
class Mixed extends Parent {}
|
|
for (var i in mixins) {
|
|
var keys = Object.keys(mixins[i]);
|
|
for (var j in keys) {
|
|
var prop = keys[j];
|
|
Mixed.prototype[prop] = mixins[i][prop];
|
|
}
|
|
}
|
|
return Mixed;
|
|
}
|