Sukima4th December 2020 at 7:31pm
Read Managing change in Ember article for more information.
<MyComponent
@value={{@thing.property}}
@update={{@thing.update.property}}
/>
If @thing
were a class (like Octane likes) then the above pattern is nothing more then a one-liner:
class Thing {
@tracked property;
update = new Proxy(this, {
get: (t, p) => Reflect.has(t, p) ? v => t[p] = v : undefined
});
}
[Anonymous]: didn't you just describe a poorer implementation of a box?[Me]: yes, yes I did 😉