UNPKG

vasille

Version:

The same framework which is designed to build bulletproof frontends (core library).

27 lines (26 loc) 502 B
/** * Describe a common binding logic * @class Binding */ export class Binding { binding; func; /** * Constructs a common binding logic * @param value {IValue} the value to bind */ constructor(value) { this.binding = value; } init(bounded) { this.func = bounded; this.binding.on(this.func); this.func(this.binding.V); } /** * Just clear bindings */ destroy() { this.binding.off(this.func); } }