APIContextinterface

{
	useAPI<PP extends P, RR extends R>(this: void, endpoint: Endpoint<PP, RR>, payload: PP): EndpointStore<PP, RR>;
	useAPI<PP extends P, RR extends R>(this: void, endpoint: Nullish<Endpoint<PP, RR>>, payload: PP): EndpointStore<PP, RR> | undefined;
	readonly APIContext: ({ children }: { children: ReactNode }) => ReactElement;
}
PropertyType
.APIContext({ children }: { children: ReactNode }) => ReactElement
The <APIContext> wrapper to give your React components access to this API provider. required readonly

Bundle of hooks and a provider component returned by createAPIContext().

Methods

Go

APIContext.useAPI()method

Get an EndpointStore for the specified endpoint/payload in the current APIProvider context.

useAPI(this: void, endpoint: Endpoint<PP, RR>, payload: PP): EndpointStore<PP, RR>
useAPI(this: void, endpoint: Nullish<Endpoint<PP, RR>>, payload: PP): EndpointStore<PP, RR> | undefined