ecmascript 6 - ES6 Class, extending Ractive -


i'm using es6 (via babel), , looking "proper" way define class extends ractive (without calling ractive.extend(...) if possible), since ractive allows new (http://docs.ractivejs.org/latest/new-ractive).

tried following approach, seems work:

class home extends ractive {   constructor() {     super();     this.template = "<h1>{{message}}</h1>";   }    data() {     return {       message: 'this sample data'     }   }    oninit() {     console.log('ok');   } } 

ractive instance initialized without error, , oninit called, template seems undefined.

i start using syntax well. :)

but spent hour month ago trying see if hackable, concluded it's not possible due how of component extension works. it's on our radar , should land in near-future version.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -