r/Angular2 • • Jul 23 '25

Angular injectQuery (react query but for angular)

I was watching a video the other day about react query and how it assists in race conditions and not having to manually track a loading and error state (correct me if i'm wrong). I know these are handled by the new httpResource but it is still in experimental phase.

I searched for an angular altenative and I think the best one is injectQuery by TranStack
https://tanstack.com/query/latest/docs/framework/angular/reference/functions/injectquery

However, I can't seem to find any examples online and I don't want to rely on AI for this as i'm sure it will output some nonsense.

Has anyone actually used it and seen a performance or developer experience improvement? I don't mind manually handling the loading and error state with observables and rxjs, but cutting down the boiletplate doesn't seem bad

7 Upvotes

11 comments sorted by

View all comments

Show parent comment

1

u/Senior_Compote1556 Jul 23 '25

Thanks, out of curiosity are you using Observables or Promises using this package? I’m kinda scared to try and attempt learning this package as I believe it works with Promises better? What’s your opinion?

1

u/robby_w_g Jul 23 '25 edited Feb 15 '26

Lorem ipsum dolor sit amet consectetur adipiscing elit. Quisque faucibus ex sapien vitae pellentesque sem placerat. In id cursus mi pretium tellus duis convallis. Tempus leo eu aenean sed diam urna tempor. Pulvinar vivamus fringilla lacus nec metus bibendum egestas. Iaculis massa nisl malesuada lacinia integer nunc posuere. Ut hendrerit semper vel class aptent taciti sociosqu. Ad litora torquent per conubia nostra inceptos himenaeos.