Skip to content

Commit 48a0507

Browse files
committed
0.4.2
1 parent c320d1c commit 48a0507

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

.size-snapshot.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
{
22
"dist/index.js": {
3-
"bundled": 31608,
4-
"minified": 15961,
5-
"gzipped": 4574
3+
"bundled": 31764,
4+
"minified": 16087,
5+
"gzipped": 4618
66
},
77
"dist/index.es.js": {
8-
"bundled": 31088,
9-
"minified": 15497,
10-
"gzipped": 4478,
8+
"bundled": 31223,
9+
"minified": 15604,
10+
"gzipped": 4516,
1111
"treeshaked": {
1212
"rollup": {
13-
"code": 3292,
13+
"code": 3329,
1414
"import_statements": 21
1515
},
1616
"webpack": {
17-
"code": 9392
17+
"code": 9422
1818
}
1919
}
2020
}

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,19 @@ A big thanks to both [Draqula](https://github.com/vadimdemedes/draqula) for insp
7979

8080
</details>
8181

82+
<details>
83+
<summary>How is this different from Zeit's SWR?</summary>
84+
<br />
85+
[Zeit's SWR](https://github.com/zeit/swr) is a great library, and is very similar is spirit and implementation to React Query with a few notable differences:
86+
87+
- React Query handles automatic cache purging for inactive queries and garbage collection. This can mean a much smaller memory footprint for apps that consume a lot of data or data that is changing often in a single session
88+
- React Query does not ship with a default fetcher (but can easily be wrapped inside of a custom hook to achieve the same functionality)
89+
- React Query uses query key generation, query variables, and implicit query groups. The query key and variables that are passed to a query are less URL-based by nature and much more flexible. Both the key (todos) and any variables ({ status: 'done' }) are used to compute the unique key for a query (and it's done in a very stable, deterministic way). This also allows you to use query "groups" when defining query refetching configs, eg. you can refetch every query that has a `todos` key, regardless of variables, or you can target specific queries with (or without) variables. This architecture is much more robust and forgiving especially for larger apps.
90+
- Query cancellation integration is baked into React Query. You can easily use this to wire up request cancellation in most popular fetching libraries, including but not limited to fetch and axios.
91+
- Overall API design opinions
92+
93+
</details>
94+
8295
## Examples
8396

8497
- [Basic](./examples/basic)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-query",
3-
"version": "0.4.1",
3+
"version": "0.4.2",
44
"description": "Hooks for managing, caching and syncing asynchronous and remote data in React",
55
"author": "tannerlinsley",
66
"license": "MIT",

0 commit comments

Comments
 (0)