File tree Expand file tree Collapse file tree 1 file changed +3
-28
lines changed
Expand file tree Collapse file tree 1 file changed +3
-28
lines changed Original file line number Diff line number Diff line change @@ -127,33 +127,6 @@ const Component = () => {
127127};
128128```
129129
130- ### Paginated requests
131-
132- ``` javascript
133- import React from " react" ;
134- import usePaginatedRequest from " react-fetch-hook/usePaginatedRequest" ;
135- import fetchSomeData from " ..."
136-
137- const Component = () => {
138- const results = usePaginatedRequest (
139- ({limit, offset}) => fetchSomeData (limit, offset),
140- 20
141- );
142-
143- return (
144- < InfiniteScroll
145- pageStart= {0 }
146- loadMore= {results .loadMore }
147- hasMore= {results .hasMore }
148- loader= {< div / > }>
149- {results .data && results .data .map ((item ) => {
150- ...
151- })}
152- < / InfiniteScroll> )
153- }
154- ```
155-
156-
157130
158131## API
159132
@@ -201,7 +174,9 @@ type TUsePromiseResult<T> = {
201174}
202175```
203176
204- ### ` usePaginatedRequest `
177+ ### Experimental: ` usePaginatedRequest `
178+ ⚠️ Warning: this method is experimental, API can be changed.
179+
205180Create a paginated request.
206181``` javascript
207182usePaginatedRequest = < T > (
You can’t perform that action at this time.
0 commit comments