campfire.js
    Preparing search index...

    Function track

    • Track an element by an arbitrary string id. This is essentially a global key-value store of elements you'd like to keep around.

      Parameters

      • id: string

        An id to track the element by. This has to be unique across your entire application.

      • elt: HTMLElement

        The element to track.

      Returns void

      // Create and track elements
      const header = document.createElement('header');
      track('main-header', header);

      // Track dynamically created elements
      const [sidebar] = nu('aside.sidebar').done();
      track('app-sidebar', sidebar);