Skip to content
This repository has been archived by the owner on Nov 23, 2024. It is now read-only.

Latest commit

 

History

History
36 lines (25 loc) · 781 Bytes

volatile_cps.md

File metadata and controls

36 lines (25 loc) · 781 Bytes

In Ember 0.9, you might have a property that looks like

age: function() {
  return this.get('createdAt') - new Date();
}.property('createdAt').volatile()

The .property('createdAt') means, "recompute this every time createdAt changes".

The .volatile() means, "recompute this every time you get it."

That means that if we had a template,

Age: {{age}}

the template would be correct on render and when createdAt changes.

In Ember 1.0, this does not work. We need to do something more like

age: function() {
  return this.get('createdAt') - new Date();
}.property().volatile()

expireAge: function() {
  this.notifyPropertyChange('age');
}.observes('createdAt')

Transition

This project currently has no tools to aid this transition.