xen-orchestra/@xen-orchestra/mixin
Julien Fontanet 2a70ebf667 docs: uniformize code blocks
- add missing syntaxes
- don't put prompt if no command outputs to ease copy/paste and use `sh` syntax
- always use `$` as prompt and use `console` syntax
2023-02-06 11:25:12 +01:00
..
.npmignore feat: unified .npmignore for all packages 2021-04-07 13:58:14 +02:00
.USAGE.md feat(mixin): add usage 2022-11-21 11:04:51 +01:00
index.js chore: enforce strict mode for CJS files 2022-02-22 12:34:41 +01:00
legacy.js chore: enforce strict mode for CJS files 2022-02-22 12:34:41 +01:00
package.json chore: update deps 2021-12-23 13:25:48 +01:00
README.md docs: uniformize code blocks 2023-02-06 11:25:12 +01:00

@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