Skip to content

Instantly share code, notes, and snippets.

@NetguruGist
Created October 31, 2015 14:50
Show Gist options
  • Save NetguruGist/25c895fdfd5375317e4b to your computer and use it in GitHub Desktop.
Save NetguruGist/25c895fdfd5375317e4b to your computer and use it in GitHub Desktop.
runloop4.2 ruby
partOfNameChanged: Ember.observer("firstName", "lastName", function() {
Ember.run.once(this, "doSomeProcessing");
})
doSomeProcessing: function() {
console.log("[Observer]: Executing...");
}
fullName: Ember.computed("firstName", "lastName", function() {
console.log("[Computed property]: Executing...");
return (this.get("firstName") + " " + this.get("lastName"));
})
toggleName: function() {
this.set("firstName", "Foo");
this.set("lastName", "Bar");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment