Logos DX
    Preparing search index...

    Function observe

    • Auto-bind behaviors to elements matching a CSS selector, both existing and dynamically added in the future via MutationObserver.

      Returns a cleanup function that disconnects the observer and runs all per-element cleanups returned by the handler.

      Parameters

      Returns Cleanup

      const stop = observe('[data-tooltip]', (el) => {
      const tip = new Tooltip(el);
      return () => tip.destroy();
      });

      stop(); // disconnects observer + destroys all tooltips