blackbox 0.2.0 copy "blackbox: ^0.2.0" to clipboard
blackbox: ^0.2.0 copied to clipboard

Deterministic reactive computation core with explicit dependency graphs, boxes, and flows. Designed for testable business logic and state pipelines.

blackbox #

Reactive state management core for Dart.

Boxes hold state. Graphs wire dependencies. No code generation. No boilerplate.

See the full documentation with examples: README

Quick Start #

import 'package:blackbox/blackbox.dart';

class CounterBox extends NoInputBox<int> {
  int _value = 0;

  @override
  int compute(int? previous) => _value;

  void inc() => action(() => _value++);
}

API #

Box Types #

Class Input Sync/Async
NoInputBox<O> none sync
Box<I, O> yes sync
NoInputAsyncBox<O> none async
AsyncBox<I, O> yes async

Graph #

final graph = Graph.builder()
    .add(boxA)
    .add(boxB, input: (d) => d.whenReady(boxA))
    .build(start: true);

Persistence #

BlackboxPersistence.init(store);
// Then use persistKey in any box constructor:
MyBox() : super(persistKey: 'my_key');

Lifecycle #

  • prepare(I input, O? previous) — called once before first compute
  • dispose() — called by graph.dispose()
  • action(() { ... }) — mutate state and trigger recomputation

License #

MIT

2
likes
140
points
362
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Deterministic reactive computation core with explicit dependency graphs, boxes, and flows. Designed for testable business logic and state pipelines.

Repository (GitHub)
View/report issues

Topics

#reactive #state-management #data-flow #dependency-graph #computation-graph

License

MIT (license)

Dependencies

meta

More

Packages that depend on blackbox