EndpointStoreclass
new EndpointStore<P, R>(endpoint: Endpoint<P, R>, payload: P, provider: APIProvider<P, R>)
| Param | Type | |
|---|---|---|
endpoint | Endpoint<P, R> | The endpoint to call. required |
payload | P | The payload to call the endpoint with. required |
provider | APIProvider<P, R> | The API provider to call the endpoint through. 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. |
| Property | Type | |
|---|---|---|
.provider | APIProvider<P, R> | The API provider this store calls the endpoint through. required readonly |
.endpoint | Endpoint<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