News for hackers. Stuff that matters.
Re:Angular 11 by geewee on Thursday November 12, 2020 @01:48PM (#25073295)
Is there a good implementation of makeObservable() somewhere? I haven't been able to find one that seemed to work elegantly.

Patching @Output and @Input is supremely painful - I really wish there was some sort of shorthand for that.

Re:Angular 11 by foepys on Friday November 13, 2020 @01:36AM (#25079619)
I cannot share the code we use directly but we use Object.defineProperty and override the getter and setter for it, tunneling the new setted value through a behavior subject that gets returned. The getter returns the value by synchronous access to the subject.

Inputs into makeObservable are the component class (this) and the requested property name (generics with keyof).

Re:Angular 11 by geewee on Friday November 13, 2020 @01:55AM (#25079721)
Oh that's a clever way of doing it. Thanks!