Skip to content

Type Alias: OptionalAsyncQueryExecutor

ts
type OptionalAsyncQueryExecutor = <R, D, T>(type: T, data?: D) => Promise<Optional<R>>;

Defined in: src/wirestate-react/types/queries.ts:101

Represents the function returned by useOptionalAsyncQueryExecutor.

Type Parameters

Type ParameterDefault typeDescription
RunknownThe result type of the query.
DunknownThe type of the data payload.
T extends QueryTypeQueryTypeThe query identifier type.

Parameters

ParameterTypeDescription
typeTThe query identifier.
data?DOptional payload for the query.

Returns

Promise<Optional<R>>

A Promise resolving to the query result, or null if no handler was found.

Remarks

Typically returned by useOptionalAsyncQueryExecutor. Returns null when no handler is registered.