Aberdeen - v1.0.4
    Preparing search index...

    Function dump

    • Renders a live, recursive dump of a proxied data structure (or any value) into the DOM at the current $ insertion point.

      Uses <ul> and <li> elements to display object properties and array items. Updates reactively if the dumped data changes. Primarily intended for debugging purposes.

      Type Parameters

      • T

        The type of the data being dumped.

      Parameters

      • data: T

        The proxied data structure (or any value) to display.

      Returns T

      The original data argument, allowing for chaining.

      import { $, proxy, dump } from 'aberdeen';

      const state = proxy({
      user: { name: 'Frank', kids: 1 },
      items: ['a', 'b']
      });

      $('h2:Live State Dump');
      dump(state);

      // Change state later, the dump in the DOM will update
      setTimeout(() => { state.user.kids++; state.items.push('c'); }, 2000);