-
Notifications
You must be signed in to change notification settings - Fork 0
/
Props.ts
38 lines (36 loc) · 1.01 KB
/
Props.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { ReactNode } from 'react';
import Id from '../../IdContext/Id';
import Reset from '../../State/Reset';
export default interface ServiceProviderProps<TRequest> {
/**
* The request passed to {@link createService | handler} for fetching an asynchronous resource.
*/
request: TRequest;
/**
* The key that identifies the {@link ServiceProvider} to be consumed
* @default null
*/
id?: Id;
/**
* @default null
*/
children?: ReactNode;
/**
* The fallback to render if any children are suspended.
* If the fallback is `null`, `undefined`, or omitted, then a Suspense
* component must be inserted elsewhere between the
* {@link ServiceProvider | Provider} and {@link ServiceConsumer | Consumer}.
* @default null
*/
fallback?: NonNullable<ReactNode> | null;
/**
* The reset function when {@link ServiceProviderProps.request | request} updates
*/
reset?: Reset<TRequest>;
}
/** @ignore */
export const defaultProps = {
id: null,
children: null,
fallback: null,
};