How do we stop Ember recompute chains?


#1

I have a property which is based on time and I have properties which depend on that property. The problem is that the whole tree gets recomputed every time the time property changes. In order to get around that problem I have introduced observers:

https://ember-twiddle.com/13b0dd883d6a37b6471489f498cc44ef?openFiles=controllers.application.js%2C

Is that the right way of accomplishing this? Further, why is it that Ember itself doesnt halt the computed chain if it notices that the computed value is === the cacheValue. Yes, two identical objects will still incur a recompute, but that should be a fast way of shortcutting a lot of recompute logic, right?


#2

You can try introducing your own your own computed property, instead of adding observers: https://ember-twiddle.com/f5ed5e16c5dd39fdf37c82cba5b5f4f4?openFiles=controllers.application.js%2C


#3

Thats still using an observer, you’ve just wrapped it in a function.