Skip to content

API Documentation / @pinia/colada / PiniaColadaQueryHooksPluginOptions

Interface: PiniaColadaQueryHooksPluginOptions

Options for PiniaColadaQueryHooksPlugin.

Properties

onError()?

ts
optional onError: <TError>(error, entry) => unknown;

Global error handler for all queries.

Type Parameters

TError

TError = unknown

Parameters

error

TError

error thrown

entry

UseQueryEntry<unknown, TError>

Returns

unknown


onSettled()?

ts
optional onSettled: <TResult, TError>(data, error, entry) => unknown;

Global handler for when a query is settled (either successfully or with an error). Will await for the onSuccess or onError handlers to resolve if they return a promise.

Type Parameters

TResult

TResult = unknown

TError

TError = unknown

Parameters

data

data returned by the query if any

undefined | TResult

error

error thrown if any

null | TError

entry

UseQueryEntry<TResult, TError>

Returns

unknown


onSuccess()?

ts
optional onSuccess: <TResult>(data, entry) => unknown;

Global handler for when a query is successful.

Type Parameters

TResult

TResult = unknown

Parameters

data

TResult

data returned by the query

entry

UseQueryEntry<TResult, unknown>

Returns

unknown

Released under the MIT License.