News for hackers. Stuff that matters.
Re:Introducing Hooks by cormacrelf on Friday October 26, 2018 @05:20AM (#18307811)
Angular's problem with observables is being completely mismatched with component state. You have to unsubscribe stuff manually all the time with any complex app, and it's a nightmare to debug when you've forgotten. You can use `@ngrx/utils` with class-property attributes now, but it's still weird and not always applicable and like most angular things, couldn't be coded by a newbie as it relies on the vomit-worthy-but-kinda-works metadata system.

AFAICT, with state+event hooks you could just write a function in a few lines to subscribe to an observable you pass to it, setState on each new value, and unsubscribe, and then use it everywhere.

(Edit: yes, of course there is the | async pipe. Not everything is in the template though.)

Re:Introducing Hooks by k__ on Friday October 26, 2018 @05:42AM (#18307895)
I always had the feeling Cycle.js is the better observable framework.