Enums & supporting types
The smaller public types: enums, filters, the cache snapshot, the user-facing exception, and the observable contract.
RefetchOnMount#
RefetchOnMount#
Controls whether a keyed Execute that finds cached data also refetches in the
background. A key with no cached data always fetches, regardless of this setting.
| Value | Type | Description |
|---|---|---|
| Never | 0 | Serve the cache and never refetch on mount. Invalidation still refetches. |
| IfStale | 1 | Refetch in the background only when the data is older than the stale time. |
| Always | 2 | Always refetch in the background, even when the data is still fresh. |
RefetchType#
RefetchType#
Which invalidated entries refetch immediately.
| Value | Type | Description |
|---|---|---|
| Active | 0 | Refetch entries that have live subscribers; entries without stay marked stale and refetch when a component next mounts on them. |
| All | 1 | Refetch every matched entry, subscribed or not. |
| None | 2 | Only mark entries stale; nothing refetches until the next mount. |
InvalidateOptions#
InvalidateOptions#
Options for DejaClient.InvalidateAsync. With Exact false (the
default) the key matches by prefix — invalidating ["todos"] also invalidates
["todos", 1]. Predicate filters the matched keys further.
QueryFilter#
QueryFilter#
Narrows which entries a key matches in DejaClient.Remove and
DejaClient.RefetchAsync. Prefix matching by default.
CacheEntryState#
CacheEntryState#
A read-only snapshot of one cache entry, returned by DejaClient.GetState.
Values are coherent with each other at the moment of the call and do not update
afterwards. The cache inspectors on this site render exactly this record.
DisplayUserException#
DisplayUserException#
An exception whose DisplayMessage is safe — and intended — to be shown to the
end user. Queries and mutations route it to the dedicated
OnDisplayUserError callbacks in addition to the general error callbacks. The
single-message constructors use the message for both display and
Exception.Message; the two-message constructors separate the user-facing
message from the internal one.
DejaObservable / IDejaObservable#
IDejaObservable#
State that can notify exactly one owner when it changes — implemented by
Query<T> and Mutation<T>, consumed by
DejaComponentBase. Attach registers the sole listener and
returns a handle whose disposal detaches it (idempotently); attaching while a listener is
already registered throws InvalidOperationException. Deliberately
single-listener rather than a multicast event: the one component that owns the state is
the only thing that may be notified by it — which is what keeps two components holding
their own queries from re-rendering each other.
DejaObservable#
Base implementation holding the single listener slot. Derived state calls
NotifyChanged() once per state transition, after every property in the
transition has been set; it is a safe no-op when nothing is attached. Extend it if you
build custom observable state that a DejaComponentBase component should
re-render for.