EndpointStoreclass

new EndpointStore<P, R>(endpoint: Endpoint<P, R>, payload: P, provider: APIProvider<P, R>)
ParamType
endpointEndpoint<P, R>
A typed API resource definition pairing a method and path with payload and result schemas. required
payloadP
required
providerAPIProvider<P, R>
Abstract base for API providers that send requests to a set of Endpoint definitions rooted at a common base URL. required
Return
EndpointStore<P, R>
Store that loads and tracks the result of calling a single API endpoint with a fixed payload, through an APIProvider.
PropertyType
.providerAPIProvider<P, R>
The API provider this store calls the endpoint through. required readonly
.endpointEndpoint<P, R>
The endpoint this store calls to fetch its result. required readonly

Store that loads and tracks the result of calling a single API endpoint with a fixed payload, through an APIProvider.

Examples

const store = new EndpointStore(endpoint, payload, provider);
 const result = await store; // R