@llm-workbench/adapters-react
v0.3.3
Published
React hooks for subscribing components to live LLM Workbench runtime state.
Downloads
365
Maintainers
Readme
@llm-workbench/adapters-react
MIT-licensed — the React binding for LLM Workbench. One hook subscribes a component to live run state, built on useSyncExternalStore (correct under React 18/19 concurrent rendering, cleans up on unmount).
npm install @llm-workbench/adapters-react @llm-workbench/runtimeUsage
import { useWorkbenchRunRevision } from "@llm-workbench/adapters-react";
function RunStatus({ runtime, runId }) {
useWorkbenchRunRevision(runtime, runId); // re-renders whenever the run changes
const state = runtime.getState(runId);
return <span>{state?.run.status}</span>;
}API surface
| Export | Role |
| --- | --- |
| useWorkbenchRunRevision(runtime, runId) | returns the current run revision (a number) and re-renders the component on every change to that run |
Docs
Overview and architecture: repository root README.md.
