Home Reference Source Test Repository

Function

Static Public Summary
public

BindAll(methods: string[]): ClassDecorator

Binds methods of an object to the object itself, overwriting the existing method.

public

Mixin(srcs: ...*): *

Static Public

public BindAll(methods: string[]): ClassDecorator source

Binds methods of an object to the object itself, overwriting the existing method.

Params:

NameTypeAttributeDescription
methods string[]
  • optional
  • default: []

Return:

ClassDecorator

Example:


@BindAll()
class MyClass {
  bound() {
    return this;
  }

  unbound() {
    return this;
  }
}

const myClass = new MyClass();

myClass.bound.call(null); // => MyClass {}
myClass.unbound.call(null); // => MyClass {}

public Mixin(srcs: ...*): * source

Params:

NameTypeAttributeDescription
srcs ...*

Return:

*