treeloom
    Preparing search index...

    Function receiveForwardedEvent

    • The receiving end of makeForwardingListener's envelope: resolve the item it was built for, replay any live target state it carried onto that item's real element (see applyTargetState and makeForwardingListener's captureTargetState), then dispatch a real event of the same type on it. The resolved item's own, already-bound listener runs exactly as it would for a genuine local event - nothing here needs to know what that listener does.

      Parameters

      • root: DomItemRoot

        The tree to resolve the envelope's itemId against. Its listeners must be the real ones (not itself set up with setForwardEvents), or this would just forward the event again instead of running it.

      • envelope: ForwardedEvent

        As produced by makeForwardingListener on the sending end.

      • Optionalvalidator: ForwardedEventValidator

        Optional: when given and it returns false for the resolved item, the event is never dispatched. Resolving by id is correct (it finds the right item even if this root's own tree shape differs from the sender's), but not authorized on its own - a validator is the one place to plug an ownership check in, instead of every caller re-deriving "resolve first, then check, then dispatch" by hand.

      Returns void