You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/angular/overview.md
+53-4Lines changed: 53 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,15 +7,60 @@ title: Overview
7
7
8
8
The `@tanstack/angular-query-experimental` package offers a 1st-class API for using TanStack Query via Angular.
9
9
10
-
## Feedback very welcome
10
+
## Feedback welcome!
11
+
11
12
We are in the process of getting to a stable API for Angular Query. If you have any feedback, please contact us at the [TanStack Discord](https://tlinz.com/discord) server or [visit this discussion](https://github.com/TanStack/query/discussions/6293) on Github.
12
13
13
14
## Supported Angular Versions
15
+
14
16
Angular Query is compatible with Angular version 17.
15
17
16
-
## Example
18
+
TanStack Query (FKA React Query) is often described as the missing data-fetching library for web applications, but in more technical terms, it makes **fetching, caching, synchronizing and updating server state** in your web applications a breeze.
19
+
20
+
## Motivation
21
+
22
+
Most core web frameworks **do not** come with an opinionated way of fetching or updating data in a holistic way. Because of this developers end up building either meta-frameworks which encapsulate strict opinions about data-fetching, or they invent their own ways of fetching data. This usually means cobbling together component-based state and side-effects, or using more general purpose state management libraries to store and provide asynchronous data throughout their apps.
23
+
24
+
While most traditional state management libraries are great for working with client state, they are **not so great at working with async or server state**. This is because **server state is totally different**. For starters, server state:
25
+
26
+
- Is persisted remotely in a location you do not control or own
27
+
- Requires asynchronous APIs for fetching and updating
28
+
- Implies shared ownership and can be changed by other people without your knowledge
29
+
- Can potentially become "out of date" in your applications if you're not careful
30
+
31
+
Once you grasp the nature of server state in your application, **even more challenges will arise** as you go, for example:
32
+
33
+
- Caching... (possibly the hardest thing to do in programming)
34
+
- Deduping multiple requests for the same data into a single request
35
+
- Updating "out of date" data in the background
36
+
- Knowing when data is "out of date"
37
+
- Reflecting updates to data as quickly as possible
38
+
- Performance optimizations like pagination and lazy loading data
39
+
- Managing memory and garbage collection of server state
40
+
- Memoizing query results with structural sharing
41
+
42
+
If you're not overwhelmed by that list, then that must mean that you've probably solved all of your server state problems already and deserve an award. However, if you are like a vast majority of people, you either have yet to tackle all or most of these challenges and we're only scratching the surface!
43
+
44
+
Angular Query is hands down one of the _best_ libraries for managing server state. It works amazingly well **out-of-the-box, with zero-config, and can be customized** to your liking as your application grows.
17
45
18
-
```typescript
46
+
Angular Query allows you to defeat and overcome the tricky challenges and hurdles of _server state_ and control your app data before it starts to control you.
47
+
48
+
On a more technical note, Angular Query will likely:
49
+
50
+
- Help you remove **many** lines of complicated and misunderstood code from your application and replace with just a handful of lines of Angular Query logic.
51
+
- Make your application more maintainable and easier to build new features without worrying about wiring up new server state data sources
52
+
- Have a direct impact on your end-users by making your application feel faster and more responsive than ever before.
53
+
- Potentially help you save on bandwidth and increase memory performance
54
+
55
+
[//]: #'Example'
56
+
57
+
## Enough talk, show me some code already!
58
+
59
+
In the example below, you can see Angular Query in its most basic and simple form being used to fetch the GitHub stats for the TanStack Query GitHub project itself:
60
+
61
+
[Open in CodeSandbox](https://codesandbox.io/s/github/tanstack/query/tree/main/examples/angular/simple)
0 commit comments