Documentation / @zerotal/inertia / InertiaProp
Abstract Class: InertiaProp
Defined in: inertia/src/props/PropTypes.ts:33
Base class for all prop wrappers. Carries the shared once() modifier and the mergeable
capability (so both MergeProp and DeferProp can be merged on the client).
Extended by
Constructors
Constructor
new InertiaProp():
InertiaProp
Returns
InertiaProp
Properties
_once
protected_once:boolean=false
Defined in: inertia/src/props/PropTypes.ts:34
_onceExpiresAt
protected_onceExpiresAt:number|null=null
Defined in: inertia/src/props/PropTypes.ts:35
_merge
protected_merge:boolean=false
Defined in: inertia/src/props/PropTypes.ts:37
_deep
protected_deep:boolean=false
Defined in: inertia/src/props/PropTypes.ts:38
_appendPaths
protected_appendPaths:string[] =[]
Defined in: inertia/src/props/PropTypes.ts:39
_prependPaths
protected_prependPaths:string[] =[]
Defined in: inertia/src/props/PropTypes.ts:40
_matchOn
protected_matchOn:string[] =[]
Defined in: inertia/src/props/PropTypes.ts:41
_prependRoot
protected_prependRoot:boolean=false
Defined in: inertia/src/props/PropTypes.ts:42
ignoreFirstLoad
readonlyignoreFirstLoad:boolean=false
Defined in: inertia/src/props/PropTypes.ts:45
When true, the prop is skipped on full/initial visits and only resolved on partial reloads.
Accessors
isOnce
Get Signature
get isOnce():
boolean
Defined in: inertia/src/props/PropTypes.ts:58
Returns
boolean
onceExpiresAt
Get Signature
get onceExpiresAt():
number|null
Defined in: inertia/src/props/PropTypes.ts:61
Returns
number | null
shouldMerge
Get Signature
get shouldMerge():
boolean
Defined in: inertia/src/props/PropTypes.ts:97
Returns
boolean
Methods
resolve()
abstractresolve():unknown
Defined in: inertia/src/props/PropTypes.ts:48
Produce the prop's value (may be async).
Returns
unknown
once()
once(
expiresAt?):this
Defined in: inertia/src/props/PropTypes.ts:53
Resolve only once; the client remembers the value across subsequent navigations.
Parameters
expiresAt?
number | null
Returns
this
merge()
merge():
this
Defined in: inertia/src/props/PropTypes.ts:68
Append new items to the existing array at the root level on partial reloads.
Returns
this
deepMerge()
deepMerge():
this
Defined in: inertia/src/props/PropTypes.ts:73
Deep-merge the whole structure into the existing prop value on partial reloads.
Returns
this
append()
append(
paths?):this
Defined in: inertia/src/props/PropTypes.ts:79
Append to specific nested path(s) of the prop, replacing the rest.
Parameters
paths?
string | string[]
Returns
this
prepend()
prepend(
paths?):this
Defined in: inertia/src/props/PropTypes.ts:85
Prepend at the root (no args) or to specific nested path(s).
Parameters
paths?
string | string[]
Returns
this
matchOn()
matchOn(
paths):this
Defined in: inertia/src/props/PropTypes.ts:92
Match existing items by a field (path's last segment) instead of appending duplicates.
Parameters
paths
string | string[]
Returns
this
mergeConfig()
mergeConfig():
MergeConfig
Defined in: inertia/src/props/PropTypes.ts:100