TanStack Query, meet RxJS – building your own TanStack query with Angular and RxJS
TanStack Query has taken over our community by storm as a go-to async state management library, and for good reason. There are many benefits to using TanStack Query, such as the following:
- Declarative data fetching
- Automatic caching and re-fetching
- Robust error-handling mechanisms – gracefully manage failures and automatically retry failed requests
- Automatic garbage collection
- Excellent developer experience – dedicated Dev Tools that make it easier to debug and inspect your queries
One thing that we may notice from the first usage when working with TanStack Query is that it only supports promises and not Observables. But asynchronous programming and handling side effects are where RxJS can really excel. So, let’s build our very own custom, minimalistic version of TanStack Query, but this time with the help of RxJS for managing async...