@wana/debug

Debug helpers and a devtools formatter

Usage no npm install needed!

<script type="module">
  import wanaDebug from 'https://cdn.skypack.dev/@wana/debug';
</script>

README

@wana/debug

Debug utils for wana

Hooks

  • useChangeLog
  • useObserverLog
  • useRenderLog
// Log changes to an observable object.
// The 2nd argument is optional. 
useChangeLog(object, { name, onChange })

// Log what's observed by a `withAuto` component on each render.
// The name is optional.
useObserverLog(name)

// Log when a `withAuto` component renders (and why).
useRenderLog()

Functions

  • logChange
  • logChanges
// Log a change object created by wana.
// The targetId is optional.
logChange(change, targetId)

// Create an observer that logs changes to an observable object.
logChanges(object, { name, onChange })