Hosanna UI API v2.3.0-next
    Preparing search index...

    VirtualNodeFieldObserverManager is a class responsible for managing field observers for virtual SG nodes. It allows adding, removing, and notifying observers of field changes.

    Implements

    Index

    Constructors

    Properties

    The node associated with this observer manager.

    observers: Record<string, FieldObserver[]> = {}

    A record of observers, keyed by field names.

    Methods

    • Notifies observers of a field change and invokes appropriate handlers.

      Parameters

      • fieldName: string

        The name of the field that changed.

      • value: any

        The new value of the field.

      Returns boolean

      true if the observers were notified successfully, otherwise false.

    • Adds an observer to a specific field based on a port or function.

      Parameters

      • fieldName: string

        The name of the field to observe.

      • portOrString: string | Function | ISGROMessagePort

        The message port or function to associate with the observer.

      • OptionalinfoFields: string[]

        Optional fields to observe for additional information.

      Returns boolean

      true if the observer was added successfully, otherwise false.

    • Adds an observer to a specific field with scoped handling for ports or functions.

      Parameters

      • fieldName: string

        The name of the field to observe.

      • portOrString: string | Function | ISGROMessagePort

        The message port, function, or string to associate with the observer.

      • OptionalinfoFields: string[]

        Optional fields to observe for additional information.

      Returns boolean

      true if the observer was added successfully, otherwise false.

    • Observe changes through a port in the current scope.

      Parameters

      • fieldName: string
      • port: ISGROMessagePort
      • OptionalinfoFields: string[]

      Returns boolean

    • Removes all observers for a specific field.

      Parameters

      • fieldName: string

        The name of the field to unobserve.

      Returns boolean

      true if the observers were removed successfully, otherwise false.

    • Removes only observers registered in the current GlobalAA.

      Parameters

      • fieldName: string

        The name of the field to unobserve.

      Returns boolean

      true if the observers were removed successfully, otherwise false.