nexa-devtools
Development tools for inspecting signals, components, and stores during development.
devSignal
Creates a tracked signal that reports reads and writes to the DevTools panel.
ts
import { devSignal } from 'nexa-devtools'
function devSignal<T>(
name: string,
initial: T
): Signal<T>| Parameter | Description |
|---|---|
name | Display name shown in DevTools |
initial | Initial value |
Example:
ts
const count = devSignal('count', 0)
count.value = 1 // reported to DevToolsdevComponent
Wraps a component to monitor its render count and lifecycle events.
ts
import { devComponent } from 'nexa-devtools'
function devComponent(
name: string,
component: Component
): ComponentExample:
ts
const App = devComponent('App', RootComponent)inspectSignals
Returns an array of all registered DevTools signals with metadata.
ts
import { inspectSignals } from 'nexa-devtools'
function inspectSignals(): DevSignalInfo[]
interface DevSignalInfo {
name: string
value: any
subscriberCount: number
version: number
}inspectComponents
Returns an array of all registered DevTools components with render metrics.
ts
import { inspectComponents } from 'nexa-devtools'
function inspectComponents(): DevComponentInfo[]
interface DevComponentInfo {
name: string
renderCount: number
lastRenderTime: number
}inspectStore
Returns the full state snapshot of a store with DevTools tracking.
ts
import { inspectStore } from 'nexa-devtools'
function inspectStore(store: Store<any>): Record<string, any>clearDevTools
Clears all registered DevTools data and resets counters.
ts
import { clearDevTools } from 'nexa-devtools'
function clearDevTools(): voidinitDevTools
Initializes the DevTools bridge and exposes the API on window.__NEXA_DEVTOOLS__ for browser extension integration.
ts
import { initDevTools } from 'nexa-devtools'
interface NexaDevToolsAPI {
inspectSignals: typeof inspectSignals
inspectComponents: typeof inspectComponents
inspectStore: typeof inspectStore
clearDevTools: typeof clearDevTools
}
function initDevTools(): NexaDevToolsAPIAfter calling initDevTools(), the following becomes available in the browser console:
ts
window.__NEXA_DEVTOOLS__.inspectSignals()
window.__NEXA_DEVTOOLS__.inspectComponents()