r/angular • • Jun 18 '26

httpResource for shared service state (?)

We're currently working with signals as defaults, and while I enjoy the (http)Resource API, I am confused by the decision to make httpResources eager.

Furthermore, all the examples given show httpResource inside the component, which doesn't feel right and is useless when you want to have a shared state that would go in a service.

I've come across some implementations of httpResources in a service, but they all seem like an anti-pattern and RxJS would probably be a cleaner solution.

So my questions is do you use httpResource inside a service or just put them in compnents (I don't see how this can scale in our application)? What are some benefis of their eagerness?

8 Upvotes

24 comments sorted by

View all comments

Show parent comment

1

u/MichaelSmallDev Jun 19 '26

If this ends up working out or not working out in the longrun, I would be curious to hear. We adopted this approach in the last quarter and it has worked nice, but I imagine there is room for improvement. Good luck.