Skip to content

Function: reportRelationCacheEvent()

ts
function reportRelationCacheEvent(
  model: LucidModel,
  event: RelationCacheEvent,
  context: RelationCacheEventContext,
): void;

Dispatches a relation-cache event to the effective handler — the model's own $resourcefulOnRelationsCacheEvent → the process-wide default → no-op.

Invoked SYNCHRONOUSLY inside a guard (a throwing handler is swallowed) and never awaited, so a host observer can neither break nor delay a cache op. When no handler resolves, this returns immediately (no logger, no allocation).

Parameters

ParameterTypeDescription
modelLucidModelThe model whose handler should be consulted.
eventRelationCacheEventThe lifecycle event that occurred.
contextRelationCacheEventContextStructured context for the event.

Returns

void