map.apps Bundle APIs 4.20.0
    Preparing search index...

    Interface Observers

    Observers encapsulates a collection of connections to event emitters, like Evented, Mutable, Watches and the like. It therefor helps you to manage multiple event connections by grouping them - e.g. for cleaning all connections at once.

    interface Observers {
        add(...handles: Handle[]): Observers;
        bind(...args: unknown[]): Observers;
        clean(...names: string[]): void;
        count(): number;
        countAll(): number;
        destroy(): void;
        group(name: string): ObserverGroup;
        isAllEmpty(): boolean;
        isEmpty(): boolean;
        onRebind(rebind: RebindCallback): Observers;
        remove(...handles: Handle[]): Observers;
    }
    Index

    Methods

    • Binds to new target observables, by invoking the rebind callback. See the class description for a sample.

      Parameters

      • ...args: unknown[]

      Returns Observers

    • Cleans any registered observer. Or, if names are defined, then only the given groups are cleaned.

      Parameters

      • ...names: string[]

      Returns void

    • The amount of registered observers at default group.

      Returns number

    • The amount of registered observers in all groups.

      Returns number

    • Destroys this Observable. It works like clean with the addition of clearing all set rebind functions.

      Returns void

    • Gets a group to scope observers.

      Parameters

      • name: string

      Returns ObserverGroup

    • True if no observer is registered in any group.

      Returns boolean

    • True if no observer is registered at default group.

      Returns boolean

    • Registers the rebind callback, which will be executed if bind is called. This is an alternative to the constructor parameter 'rebind'.

      Parameters

      Returns Observers

    • Removes observer handles from default group.

      Parameters

      Returns Observers