Hacker News new | ask | show | jobs
by throw310822 14 days ago
The problem with Angular is that the http client service used to return observables by default and that made people think that you had to use them as such. It was a mostly useless, massive pain. Working with Angular became a pleasure the moment we decided to just cast our service calls to promises.

For the rest, RxJS is cool where you actually need it and want it.

2 comments

Agree. RxJS is a beast to approach at first but it's a genuinely cool library, as long as you don't spread observable around when you don't actually need them. I used the same approach for a few years (pushing my http calls behind domain-specific api services that only return promise), and it's way simpler to handle.

I still use RxJS, but mostly in the top-level component and/or service who orchestrate between data, url state and api responses. Those top-level page usually keep the default change detection instead of the 'on-push' strategy).

I never understood the problem with the rxjs, its a challenge to learn for those not used to the pattern but its very nice.

Regardless signals is also fine, we have ways now to interop between rxjs to signal for those looking for it:

https://angular.dev/api/core/rxjs-interop/toSignal

Personally the http client workflow is fine. Usually lives in a service and exposes the needed values in any form we want.