ReadonlytotalObservable emitting the current reference count. undefined until the first successful load.
The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
Optionaloptions: boolean | AddEventListenerOptionsDrops the cached count (if any) without changing the current unique, so the next getTotalAsync call
re-reads it from the server. Cheaper than reload for lazy (prefetch: false) consumers that don't
need the fresh value immediately — e.g. right after a publish/unpublish/schedule action.
Callback method called with the resolved context instance or undefined.
Reference to the created Context Consumer Controller instance
Subscribe to a context. The callback fires when the context resolves, again if the context is replaced, and can also be invoked with undefined if the context is unprovided or the host disconnects. Use this whenever a controller or element needs the context at setup time — both for ongoing observation and for reading values immediately on resolve. This is the default choice; prefer it over getContext unless the context is only needed inside a later user action.
The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().
Optionaloptions: UmbClassGetContextOptions
Options for resolving the context once, including timeout-related behavior such as preventTimeout.
A Promise resolving to the Context API instance when available, or undefined when applicable.
Retrieve a context once as a Promise. Use this only when the context is first needed inside a user action or event handler that runs later (for example a button click, a property action, or an entity action execute()). For setup-time access — including a single immediate read — use consumeContext instead so the controller lifecycle handles resolution and cleanup. The returned Promise may reject if the context is not found before the default timeout; callers should handle rejection and/or pass preventTimeout in the options when waiting longer is expected.
Get the current reference count, if known. undefined means it hasn't loaded yet — prefer
getTotalAsync when the caller needs a definite answer.
Get the current reference count, loading it first if it hasn't loaded yet. Use this at decision points (e.g. "should a confirmation dialog open?") so an unlucky race with the initial load can't silently read as 0. Piggybacks on a reload already in flight (e.g. from setUnique) rather than starting a second, redundant one — starting a second one here would race the first and could win with a stale/empty result.
The reference count.
An Observable to observe from.
Optionalcallback: ObserverCallback<UmbObserverValueType<ObservableType>>
Callback method called when data is changed.
OptionalcontrollerAlias: UmbControllerAlias | null
Define an explicit controller alias. If not defined then one will be generated based on the callback function. If null is parsed no controller alias will be given.
Reference to the created Observer Controller instance.
The API instance to be exposed.
Reference to the created Context Provider Controller instance
Reload the reference count for the current unique.
The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.
Optionaloptions: boolean | EventListenerOptionsSet the entity to count references for. A no-op if the unique is unchanged. When prefetch is enabled
(the default), also (re)loads the count immediately; otherwise the count is loaded lazily, on the first
getTotalAsync call.
The unique identifier of the entity, or undefined to clear.
Tracks the total number of items referencing a given entity, so a consumer (e.g. a publishing workspace context) can make a decision that depends on the count (like whether to show a confirmation dialog) without awaiting a network round-trip at the point of decision.
Exports
UmbEntityReferenceCountManager