Prop types for Inertia v3 responses.
A prop value is either a plain value, a 0-arity fn (evaluated only when the
prop is included in the response), or a Prop built by the constructors
below. Constructors compose, so (merge (defer f)) is a deferred prop that
the client appends to once it arrives.
Prop types for Inertia v3 responses. A prop value is either a plain value, a 0-arity fn (evaluated only when the prop is included in the response), or a `Prop` built by the constructors below. Constructors compose, so `(merge (defer f))` is a deferred prop that the client appends to once it arrives.
(->prop x)Coerces any prop value to a Prop.
Coerces any prop value to a `Prop`.
(always v)Sent on every response, including partial reloads that did not ask for it.
Sent on every response, including partial reloads that did not ask for it.
(deep-merge v)(deep-merge v {:keys [match-on]})The client deep-merges this prop into its current value. :match-on paths
are relative to the prop, e.g. "data.id".
The client deep-merges this prop into its current value. `:match-on` paths are relative to the prop, e.g. "data.id".
(defer f)(defer f group)Skipped on full visits and listed in the page's deferredProps under
group. The client fetches each group with an automatic partial reload
after the page mounts.
Skipped on full visits and listed in the page's `deferredProps` under `group`. The client fetches each group with an automatic partial reload after the page mounts.
(merge v)(merge v {:keys [match-on]})The client appends this prop to its current value instead of replacing it.
:match-on names the field (or fields) used to replace existing items.
The client appends this prop to its current value instead of replacing it. `:match-on` names the field (or fields) used to replace existing items.
(once f)(once f {:keys [key expires-at fresh?]})Resolved once and remembered by the client; later full visits skip it while the client still holds an unexpired copy.
Options: :key client cache key (defaults to the prop name) :expires-at epoch millis, or nil for no expiry :fresh? always resolve and replace the client's copy
Resolved once and remembered by the client; later full visits skip it while the client still holds an unexpired copy. Options: :key client cache key (defaults to the prop name) :expires-at epoch millis, or nil for no expiry :fresh? always resolve and replace the client's copy
(optional f)Skipped on full visits and not announced. Sent only when a partial reload
asks for it, e.g. router.reload({only: ['permissions']}).
Skipped on full visits and not announced. Sent only when a partial reload
asks for it, e.g. `router.reload({only: ['permissions']})`.(prepend v)(prepend v {:keys [match-on]})Like merge, but the client prepends.
Like `merge`, but the client prepends.
(scroll f)(scroll f {:keys [data-key meta]})An infinite-scroll prop. The client appends items found under :data-key
(default "data") and uses the scroll metadata to request more pages.
:meta is a map, or a fn of the resolved value, returning any of
:page-name, :previous-page, :next-page, :current-page.
An infinite-scroll prop. The client appends items found under `:data-key` (default "data") and uses the scroll metadata to request more pages. `:meta` is a map, or a fn of the resolved value, returning any of :page-name, :previous-page, :next-page, :current-page.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |