mirror of
https://github.com/vatesfr/xen-orchestra.git
synced 2026-09-10 22:14:48 -05:00
@xen-orchestra/mixin
Install
Installation of the npm package:
npm install --save @xen-orchestra/mixin
Usage
- mixins can depend on each other, they will be instantiated on-demand
import mixin from '@xen-orchestra/mixin'
class MyMixin {
constructor(app, ...mixinParams) {}
foo() {}
}
class App {
constructor() {
mixin(this, { MyMixin }, [...mixinParams])
}
}
app = new App()
app.myMixin.foo()
Contributions
Contributions are very welcomed, either on the documentation or on the code.
You may:
- report any issue you've encountered;
- fork and create a pull request.