jsnanigans/blac has 41 GitHub stars and 2 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-15 20:21 UTC. Last push 2026-11-14.
What you can do
- Class-based state containers — Business logic lives in typed classes, not components
- Automatic re-render optimization — Proxy-based tracking detects which properties you read and only re-renders when those change
- Zero providers — No context wrappers. Import a class, call useBloc, done
- Lifecycle management — Registry handles instance creation, sharing, ref counting, and disposal
Measured star growth
- in 24h
- 0
- in 7 days
- Update delayed
- in 15 days
- Update delayed
- in 1 month
- Update delayed
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
About
Zero-provider, type-safe state management — class-based BLoC pattern for React and Preact with automatic property tracking
Web & AppsREADME.md
OriginalBlaC
Type-safe, class-based state management for React with automatic re-render optimization.
Documentation · npm · GitHub
[!WARNING] BlaC v2 is in pre-release (beta). While in beta, breaking API changes may ship in patch releases without a major version bump. Pin an exact version and check the changelog before upgrading. Strict semver resumes once v2 is officially out of beta.
Features
- Class-based state containers — Business logic lives in typed classes, not components
- Automatic re-render optimization — Proxy-based tracking detects which properties you read and only re-renders when those change
- Zero providers — No context wrappers. Import a class, call
useBloc, done - Lifecycle management — Registry handles instance creation, sharing, ref counting, and disposal
- Plugin system — DevTools, logging, and persistence (IndexedDB or Web Storage) out of the box
- React bindings —
useBlocsubscribes viauseSyncExternalStoreand tracks reads through a proxy, re-rendering only for the paths a component actually reads - Framework-agnostic core —
@blac/corehas no React dependency; state can be read and observed throughwatch()outside of React
Quick Start
pnpm add @blac/core @blac/react
import { Cubit } from '@blac/core';
import { useBloc } from '@blac/react';
class CounterCubit extends Cubit<{ count: number }> {
constructor() {
super({ count: 0 });
}
increment = () => this.emit({ count: this.state.count + 1 });
}
function Counter() {
const [state, counter] = useBloc(CounterCubit);
return <button onClick={counter.increment}>{state.count}</button>;
}
Only state.count is tracked — the component won't re-render if other properties change.
Packages
| Package | Description |
|---|---|
@blac/core |
State containers, registry, plugins, watch & tracking utilities |
@blac/react |
React hook (useBloc) with proxy-based auto-tracking |
@blac/async |
Resources and mutations kept in state, with tag invalidation |
@blac/devtools-connect |
DevTools connection plugin (browser inspector) |
@blac/devtools-ui |
Embeddable DevTools UI — overlay or Picture-in-Picture |
@blac/logging-plugin |
Console logging with memory monitoring |
@blac/plugin-persist |
IndexedDB and Web Storage persistence with hydration |
Development
This is a pnpm workspace monorepo using Vite+ for builds.
pnpm install
pnpm dev # watch all packages
pnpm build # build all packages
pnpm --filter @blac/core test # test a specific package
pnpm typecheck # type check all packages
pnpm lint # lint all packages