Przejdź do głównej zawartości

Interface: UseNewsletterIncentiveReturn

Result shape — the active query adapter's state (lite engine or registered library).

Extends

Properties

data

data: NewsletterIncentiveQuery | undefined

Inherited from

UseStorefrontQueryResult.data


error

error: StorefrontError | null

Last error for the current key, or null.

Inherited from

StorefrontQueryState.error


incentive

incentive: Pick<NewsletterIncentive, "isEnabled" | "discountType" | "discountPercent" | "validityDays"> & object | null

The incentive payload, or null while loading / on error. Gate the banner on incentive?.isEnabled.


isError

isError: boolean

Inherited from

StorefrontQueryState.isError


isFetching

isFetching: boolean

A request is in flight (first load or a refetch).

Inherited from

StorefrontQueryState.isFetching


isLoading

isLoading: boolean

A request is in flight AND there is no data yet (isPending && isFetching) — the right gate for a first-load spinner. false when the query is gated off, so a signed-out account read shows its empty state instead of an endless spinner.

Inherited from

StorefrontQueryState.isLoading


isPending

isPending: boolean

true until the current inputs settle for the first time — INCLUDING while the query is gated off (enabled: false). For a loading spinner use isLoading, not this, or a gated (e.g. signed-out) query would render a spinner forever.

Inherited from

StorefrontQueryState.isPending


isSuccess

isSuccess: boolean

Inherited from

StorefrontQueryState.isSuccess


refetch

refetch: () => void

Re-run the read for the current inputs. Stable reference.

Returns

void

Inherited from

UseStorefrontQueryResult.refetch