AmpersandJS / ampersand-virtual-dom-mixin

MIT License
33 stars 3 forks source link

ampersand-virtual-dom-mixin

NOTE: this module is intentially at 0.x.x since the public api is still under discussion. minor/patch releases may be breaking changes until 1.0.0 hits. Community feedback wanted

var vdomMixin = require('ampersand-virtual-dom-mixin');
var View = require('ampersand-view');

var MyView = View.extend(vdomMixin, {
    template: require('my-template.jade'), //if useing jadeify, or whatever

    initialize: function () {
        //you just need to trigger render when things change,
        //the simplest might be:

        this.on('change', this.render);
    }
});

Notes on usage of this version: