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
This **tiny** library only **does one small thing**, and **does it well**.
6
+
This **tiny** library only **does one thing**, and **does it well**.
7
7
8
8
Don't expect it to grow in size, it is **feature complete**:
9
9
@@ -49,11 +49,9 @@ Don't expect it to grow in size, it is **feature complete**:
49
49
- SSR
50
50
- router integration for render-as-you-fetch pattern
51
51
52
-
You can indeed build on top of this little lib to provide more advanced features, if you like composition, that is encouraged in the React ecosystem.
52
+
You can build on top of this little lib to provide more advanced features (using composition), or move to popular full-featured libraries like [SWR](https://github.com/vercel/swr) or [React-Query](https://github.com/tannerlinsley/react-query).
53
53
54
-
If you prefer a full-featured fetching library, try [SWR](https://github.com/vercel/swr) or [React-Query](https://github.com/tannerlinsley/react-query).
55
-
56
-
## Usecase: loading async data into a component
54
+
## Use-case: loading async data into a component
57
55
58
56
The ability to inject remote/async data into a React component is a very common React need. Later we might support Suspense as well.
## Use-case: injecting async feedback into buttons
84
82
85
83
If you have a Todo app, you might want to show some feedback into the "create todo" button while the creation is pending, and prevent duplicate todo creations by disabling the button.
86
84
@@ -146,7 +144,7 @@ module.exports = {
146
144
147
145
It is possible to debounce a promise.
148
146
149
-
I recommend [awesome-debounce-promise](https://github.com/slorber/awesome-debounce-promise), as it handles nicely potential concurrency issues and have React in mind (particularly the common usecase of a debounced search input/autocomplete)
147
+
I recommend [awesome-debounce-promise](https://github.com/slorber/awesome-debounce-promise), as it handles nicely potential concurrency issues and have React in mind (particularly the common use-case of a debounced search input/autocomplete)
150
148
151
149
As debounced functions are stateful, we have to "store" the debounced function inside a component. We'll use for that [use-constant](https://github.com/Andarist/use-constant) (backed by `useRef`).
0 commit comments