@openmrs/esm-framework
Version:
101 lines (56 loc) • 2.92 kB
Markdown
[@openmrs/esm-framework](../API.md) / UseServerFetchAllOptions
| Name |
| :------ |
| `R` |
- [`UseServerInfiniteOptions`](UseServerInfiniteOptions.md)<`R`\>
↳ **`UseServerFetchAllOptions`**
- [immutable](UseServerFetchAllOptions.md
- [partialData](UseServerFetchAllOptions.md
- [swrInfiniteConfig](UseServerFetchAllOptions.md
- [fetcher](UseServerFetchAllOptions.md
• `Optional` **immutable**: `boolean`
If true, sets these options in swrInfintieConfig to false:
revalidateIfStale, revalidateOnFocus, revalidateOnReconnect
This should be the counterpart of using useSWRImmutable` for `useSWRInfinite`
[](UseServerInfiniteOptions.md).[immutable](UseServerInfiniteOptions.md
[](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-react-utils/src/useOpenmrsInfinite.ts#L26)
___
• `Optional` **partialData**: `boolean`
If true, the data of any page is returned as soon as they are fetched.
This is useful when you want to display data as soon as possible, even if not all pages are fetched.
If false, the returned data will be undefined until all pages are fetched. This is useful when you want to
display all data at once or reduce the number of re-renders (to avoid confusing users).
[](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-react-utils/src/useOpenmrsFetchAll.ts#L21)
___
• `Optional` **swrInfiniteConfig**: `SWRInfiniteConfiguration`<`any`, `any`, `BareFetcher`<`any`\>\>
[](UseServerInfiniteOptions.md).[swrInfiniteConfig](UseServerInfiniteOptions.md
[](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-react-utils/src/useOpenmrsInfinite.ts#L28)
▸ `Optional` **fetcher**(`key`): `Promise`<[`FetchResponse`](FetchResponse.md)<`R`\>\>
The fetcher to use. Defaults to openmrsFetch
| Name | Type |
| :------ | :------ |
| `key` | `string` |
`Promise`<[`FetchResponse`](FetchResponse.md)<`R`\>\>
[](UseServerInfiniteOptions.md).[fetcher](UseServerInfiniteOptions.md
[](https://github.com/openmrs/openmrs-esm-core/blob/main/packages/framework/esm-react-utils/src/useOpenmrsInfinite.ts#L19)