Skip to content

dump

dump<T>(data): T

Defined in: aberdeen.ts:3578

Renders a live, recursive dump of a proxied data structure (or any value) into the DOM at the current A 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.

T

The type of the data being dumped.

T

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

T

The original data argument, allowing for chaining.

Dumping reactive state

import A from 'aberdeen';
const $state = A.proxy({
user: { name: 'Frank', kids: 1 },
items: ['a', 'b']
});
A('h2#Live State Dump');
A.dump($state);
// Change state later, the dump in the DOM will update
setTimeout(() => { $state.user.kids++; $state.items.push('c'); }, 2000);