News for hackers. Stuff that matters.
Re:Introducing Hooks by k__ on Thursday October 25, 2018 @01:32PM (#18302686)
Cool idea, feels a bit like observables, especially the unsunscription via returned callback.

The call order thing seems odd. Don't know how to sell this to people.

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.
Re:Introducing Hooks by nyclowkey on Thursday October 25, 2018 @03:09PM (#18303644)
After a go around only 3/31 people at our department agreed to adopt this.