31 ms·
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
by cormacrelf 8y ago
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.)
- k__ 8y agoI always had the feeling Cycle.js is the better observable framework.