function mixin<T extends { new (...args: any[]): {} }>(base: T, obj) { return class extends base { constructor(...args: any[]) { super(...args); Object.assign(this, obj); } }; } export default mixin;