0.2.0 • Published 9 months ago

@xen-orchestra/mixin v0.2.0

Weekly downloads
1
License
ISC
Repository
github
Last release
9 months ago

@xen-orchestra/mixin

Package Version License PackagePhobia Node compatibility

Install

Installation of the npm package:

npm install --save @xen-orchestra/mixin

Usage

  • mixins can depend on each other, they will be instanciated 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.

License

ISC © Vates SAS