This is cool …

Haven’t updated this in a REALLY LONG TIME, but progress on my framework is going well. I’ve definitely moved towards React with it and introduced ES6 with the help of Babel / Gulp.

I’m testing out child components and just coded up this little button thing. Really simple, but it’s damned cool to see how little coding it can take on the front end when properly support on the back side with framework architecture.

let counter = 0;

export default Nori.view().createComponent({

  getDOMEvents() {
    return {
      'click button': () => this.setProps({label:'Clicked ' + (++counter) + ' times'})
    };
  },

  template(props, state) {
    return this.from(`
      <div>
        <button>{{label}}</button>
      </div>
    `);
  }

});

 

Leave a Reply