JSFiddle - React, Tailwind, and code Playground

by krisselden

HTML

<script src="https://github.com/downloads/emberjs/ember.js/ember-latest.js"></script>

JavaScript

function log(msg) {
    $('<p>').html(msg).appendTo('body');
}

Obj = Em.Object.extend({

    boundPropertyBinding: Em.Binding.oneWay('prop'),

    dependentProperty: function() {
        return this.get('prop');
    }.property('prop').cacheable(),

    watchBound: function() {
        log('bound changed to: %@'.fmt(this.get('boundProperty')));
    }.observes('boundProperty'),

    watchDependent: function() {
        log('dependent changed to: %@'.fmt(this.get('dependentProperty')));
    }.observes('dependentProperty')

});

o = Obj.create();
Em.run(function () {
o.set('prop', 'foo');
});

o.set('prop', 'bar');