suspense-service / Exports / useServiceState
▸ useServiceState<TRequest, TResponse>(service: Service<TRequest, TResponse>, id?: Id): [TResponse, Dispatch<SetStateAction<TRequest>>]
Synchronously consumes a stateful response from a ServiceProvider
| Name |
|---|
TRequest |
TResponse |
| Name | Type | Description |
|---|---|---|
service |
Service<TRequest, TResponse> | the Service to use |
id? |
Id | the ServiceProvider id to use |
Returns: [TResponse, Dispatch<SetStateAction<TRequest>>]
Defined in: Service/index.ts:52