Skip to content

Type Alias: OptionalQueryExecutor

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

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

Represents the unction returned by useOptionalQueryExecutor.

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

Optional<R>

The synchronous query result, or null if no handler was found.

Remarks

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