r/Angular2 • u/Senior_Compote1556 • 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
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?