I have a use-case for dynamically determining a computed property key from another property on an object. I created a CP macro called Ember.computed.dynamic
that takes two properties on the current object: the first one is the property that has a value that will change, the second one evaluates to the key we need from the first. All of this leads to a UI where the user can hide/show the values they want, sort them, and I can live-update them via ajax polling.
My Ember.computed.dynamic
macro is mostly working. I’ve put together a silly example of this working in a jsbin.
The only problem I’m running into is that the dynamic bindings cannot be created until the first time the property is retrieved.
This seems like the strong use case @pwagenet mentioned in #1128. Would it be worth trying to integrate this into ember-metal/lib/computed.js
and sending a PR?
Along those lines, is anyone willing to pair with me to fix the problem I mentioned above?