BlaC ships with a full DevTools suite: an in-app overlay, a Chrome DevTools panel, and a console API. Together they let you inspect live instances, view state diffs, browse event timelines, and time-travel to previous states.
DevTools is delivered as a plugin: once installed, it observes every state container from the outside, so there is nothing to wire up per bloc. Keep it scoped to environment: 'development' — it tracks state snapshots and event history, which you do not want in a production bundle.
Drop <BlacDevtoolsUi /> anywhere in your tree. It renders a draggable floating overlay that you toggle with Alt+D (or by dispatching a blac-devtools-toggle custom event).
Install the BlaC Chrome Extension from the Chrome Web Store (or build from apps/devtools-extension/). Once installed, a BlaC tab appears in Chrome DevTools alongside Elements, Console, etc.
The extension connects automatically when the browser plugin is active — no extra configuration needed. It stays in sync across page reloads.
When you select an instance, the detail panel shows a side-by-side diff of the previous and current state. Each state change is recorded with a timestamp and the call stack that triggered it.
Click any snapshot in the state history to restore the instance to that point. This calls emit on the instance with the stored state, so your components update in real time.
Cubit<S> is a StateContainer<S> that exposes mutation publicly.
That is the whole difference, and it is a real one: on StateContaineremit / patch / update are protected, so a container mutates itself
from its own methods and callers go through the API it chooses to publish.
Cubit re-declares the three as public for the cases where a caller
legitimately drives state from outside — test helpers, devtools
time-travel, benchmarks.
Reach for StateContainer when business logic should live in the class,
and Cubit when the caller owns the transitions.
Cubit<S> is a StateContainer<S> that exposes mutation publicly.
That is the whole difference, and it is a real one: on StateContaineremit / patch / update are protected, so a container mutates itself
from its own methods and callers go through the API it chooses to publish.
Cubit re-declares the three as public for the cases where a caller
legitimately drives state from outside — test helpers, devtools
time-travel, benchmarks.
Reach for StateContainer when business logic should live in the class,
and Cubit when the caller owns the transitions.
Cubit<{
frame: number
frame:number }> {
constructor() {
super({
frame: number
frame: 0 });
}
}
The DevTools plugin skips these instances entirely — no tracking overhead. excludeFromDevTools is one of the blac() configuration options; this page shows it in use, but Configuration documents the full option set.