Creating a computed from outside of your class

If you use volatile computed properties, you can completely avoid caching of your CPs, thus making sure that the returned value is fresh from your private object.

Besides, the new CP syntax introduced in Ember 1.12 allows for a much easier get/set behaviour.

I’ve fixed your Twiddle so it doesn’t use observers, that have been declared evil; read here and see @stefan here about observers.

Here’s the code.

EDIT: missing links… :-/

Hope this helps,

1 Like