Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "mixins/ienable"

Index

Interfaces

Variables

Variables

Const IEnableMixin

IEnableMixin: _mixin = mixin(<IEnable<any>>{_enabled: true,isEnabled(this: _IEnable) {return this._enabled;},enable(this: _IEnable) {this._enabled = true;if (this.notify) {this.notify({ id: EVENT_ENABLE, target: this });}},disable(this: _IEnable) {this._enabled = false;if (this.notify) {this.notify({ id: EVENT_DISABLE, target: this });}},toggle(this: _IEnable) {this._enabled ? this.disable() : this.enable();return this._enabled;},})

Mixin class decorator, injects IEnable default implementation, incl. a _enabled property. If the target also implements the {@link @thi.ng/api#INotify} interface, IEnable.enable and IEnable.disable will automatically emit the respective events.

Generated using TypeDoc