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
refactor!: replace LoadingState with React Query's isLoading/isFetching
BREAKING CHANGE: Hooks no longer return `state` property. Use `isLoading`
and `isFetching` booleans instead.
- Update hooks to return React Query's isLoading/isFetching directly
- Update all tests to check isLoading instead of state
- Update example app (Main/index.jsx, ItemDetails.jsx) to use isLoading
- Update README with new API documentation
Eliminates duplicate state management and provides more granular loading control.
|`limit`|`number`| The number of results returned per result page. |
317
320
|`setLimit(limit)`|`function`| Callback to set `limit`. `limit` must be a `number`, or `undefined` to reset. |
318
321
|`results`|`object`| The result of the last search query; a [GeoJSON `FeatureCollection` with additional members](https://github.com/radiantearth/stac-api-spec/blob/v1.0.0-rc.2/fragments/itemcollection/README.md). `undefined` if the search request has not been submitted, or if there was an error. |
319
-
|`state`|`string`| The status of the request. `"IDLE"` before and after the request is sent or received. `"LOADING"` when the request is in progress. |
322
+
|`isLoading`|`boolean`|`true` when the initial request is in progress. `false` once data is loaded or an error occurred. |
323
+
|`isFetching`|`boolean`|`true` when any request is in progress (including background refetches and pagination). `false` otherwise. |
320
324
|`error`|[`Error`](#error)| Error information if the last request was unsuccessful. `undefined` if the last request was successful. |
321
325
|`nextPage`|`function`| Callback function to load the next page of results. Is `undefined` if the last page is the currently loaded. |
322
326
|`previousPage`|`function`| Callback function to load the previous page of results. Is `undefined` if the first page is the currently loaded. |
0 commit comments