🎯
Type-Safe State Management
Full TypeScript support with inferred types for state, events, and props.
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>;
}npm install @blac/core @blac/react