3
3
[ ![ NPM] ( https://img.shields.io/npm/dm/react-async-hook.svg )] ( https://www.npmjs.com/package/react-async-hook )
4
4
[ ![ Build Status] ( https://travis-ci.com/slorber/react-async-hook.svg?branch=master )] ( https://travis-ci.com/slorber/react-async-hook )
5
5
6
- This library only ** does one small thing** , and ** does it well** .
6
+ This ** tiny ** library only ** does one small thing** , and ** does it well** .
7
7
8
- Don't expect it to grow in size, because it is ** feature complete** :
8
+ Don't expect it to grow in size, it is ** feature complete** :
9
9
10
10
- Handle fetches (` useAsync ` )
11
11
- Handle mutations (` useAsyncCallback ` )
@@ -23,25 +23,19 @@ Don't expect it to grow in size, because it is **feature complete**:
23
23
24
24
## Small size
25
25
26
- - Tiny (1.5k minified gzipped)
27
- - At least 3 times smaller than popular alternatives.
28
- - CommonJS + ESM bundles, tree-shakable
29
- - Design using composition, good tree-shakeability
30
-
31
- ** react-async-hook** :
32
-
33
- - ![ ] ( https://img.shields.io/bundlephobia/min/react-async-hook.svg )
34
- - ![ ] ( https://img.shields.io/bundlephobia/minzip/react-async-hook.svg )
35
-
36
- ** React-Query** :
37
-
38
- - ![ ] ( https://img.shields.io/bundlephobia/min/react-query.svg )
39
- - ![ ] ( https://img.shields.io/bundlephobia/minzip/react-query.svg )
40
-
41
- ** SWR** :
42
-
43
- - ![ ] ( https://img.shields.io/bundlephobia/min/swr.svg )
44
- - ![ ] ( https://img.shields.io/bundlephobia/minzip/swr.svg )
26
+ - Tiny
27
+ - Way smaller than popular alternatives
28
+ - CommonJS + ESM bundles
29
+ - Tree-shakable
30
+
31
+ | Lib | min | min.gz |
32
+ | -------------------- | ---------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
33
+ | ** React-Async-Hook** | [ ![ ] ( https://img.shields.io/bundlephobia/min/react-async-hook.svg )] ( https://bundlephobia.com/package/react-async-hook ) | [ ![ ] ( https://img.shields.io/bundlephobia/minzip/react-async-hook.svg )] ( https://bundlephobia.com/package/react-async-hook ) |
34
+ | ** SWR** | [ ![ ] ( https://img.shields.io/bundlephobia/min/swr.svg )] ( https://bundlephobia.com/package/swr ) | [ ![ ] ( https://img.shields.io/bundlephobia/minzip/swr.svg )] ( https://bundlephobia.com/package/swr ) |
35
+ | ** React-Query** | [ ![ ] ( https://img.shields.io/bundlephobia/min/react-query.svg )] ( https://bundlephobia.com/package/react-query ) | [ ![ ] ( https://img.shields.io/bundlephobia/minzip/react-query.svg )] ( https://bundlephobia.com/package/react-query ) |
36
+ | ** React-Async** | [ ![ ] ( https://img.shields.io/bundlephobia/min/react-async.svg )] ( https://bundlephobia.com/package/react-async ) | [ ![ ] ( https://img.shields.io/bundlephobia/minzip/react-async.svg )] ( https://bundlephobia.com/package/react-async ) |
37
+ | ** Use-HTTP** | [ ![ ] ( https://img.shields.io/bundlephobia/min/use-http.svg )] ( https://bundlephobia.com/package/use-http ) | [ ![ ] ( https://img.shields.io/bundlephobia/minzip/use-http.svg )] ( https://bundlephobia.com/package/use-http ) |
38
+ | ** Rest-Hooks** | [ ![ ] ( https://img.shields.io/bundlephobia/min/rest-hooks.svg )] ( https://bundlephobia.com/package/rest-hooks ) | [ ![ ] ( https://img.shields.io/bundlephobia/minzip/rest-hooks.svg )] ( https://bundlephobia.com/package/rest-hooks ) |
45
39
46
40
## Things we don't support (by design):
47
41
0 commit comments