TrackDSL
DSL support for track.
Installation
npm
npm install track-dsl
Usage
For example, create DSL having #getter
and #setter
.
static { ; // Define instance.foo ; // Define instance.bar ; // Define instance.piyo= }
Define DSL
const TrackDSL = ; { const dsl = this 'getter': func: this_defineGetter binding: this 'setter': func: this_defineSetter binding: this ; dsl; } { Object; } { Object; }
Use
const hoge = ; hogepiyo = 'piyo';hogefoo;
Base class.
Use track-dsl/lib/base
.
const TrackDSLBase = ; extend TrackDSLBase static { return 'getter': func: this_defineGetter binding: this } { this; } extend BaseA static { return 'setter': func: this_defineSetter binding: this } extend BaseB static { ; // Define instance.foo } extend ClassA static { ; // Define instance.bar }
ClassB will define getter foo and setter bar.