@ject/mixin

Create mixin class inherits from multiple bases

Usage no npm install needed!

<script type="module">
  import jectMixin from 'https://cdn.skypack.dev/@ject/mixin';
</script>

README

@ject/mixin

Make class mixin.

npm version npm download monthly npm download total npm dependents npm license pp install size github commit last github commit total

Features

  • Make class mixin

Install

$ npm install @ject/mixin

Usage

import { Callable } from '@ject/mixin'
// inherit the class Callable
class CallableClass extends Callable {
  constructor (a, b) {
    super(row => this.a + this.b + row)
    this.a = a
    this.b = b
  }
}

const callableClass = new CallableClass(5, 4)
console.log(callableClass(3)) // 12

Meta

LICENSE (MIT)