You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importEmberfrom'ember';importcomputedfrom'ember-macro-helpers/computed';exportdefaultEmber.Component.extend({key1: false,key2: true,result: computed(Ember.computed.or('key1','key2'),value=>{console.log(value);// true// do something else})});
But as you know, using an arrow function for result's callback will not allow access to the current object instance as this. In this case, you are not using this so the example is technically correct, but it seems to be tripping folks up a bit (saw some convo in slack about this).
The text was updated successfully, but these errors were encountered:
but then again if you wanted to access aNumber from that function you should've declared it as a dependent key and then it would've been available as an argument to that function 😉
I'd agree though that this has potential to be misunderstood and it probably won't do any harm if a non-arrow function would be used in that example.
The README shows the following example:
But as you know, using an arrow function for
result
's callback will not allow access to the current object instance asthis
. In this case, you are not usingthis
so the example is technically correct, but it seems to be tripping folks up a bit (saw some convo in slack about this).The text was updated successfully, but these errors were encountered: