https://github.com/alloc/wana-debug
Debug utils for wana
https://github.com/alloc/wana-debug
debug wana
Last synced: 11 months ago
JSON representation
Debug utils for wana
- Host: GitHub
- URL: https://github.com/alloc/wana-debug
- Owner: alloc
- Created: 2019-12-04T23:34:49.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-08-03T06:32:52.000Z (over 2 years ago)
- Last Synced: 2025-02-11T23:54:10.748Z (12 months ago)
- Topics: debug, wana
- Language: TypeScript
- Homepage:
- Size: 270 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# @wana/debug
Debug utils for `wana`
### Hooks
- `useChangeLog`
- `useObserverLog`
- `useRenderLog`
```tsx
// 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`
```ts
// 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 })
```