caffeine 2.0.0 copy "caffeine: ^2.0.0" to clipboard
caffeine: ^2.0.0 copied to clipboard

A reactive microstore for Dart. Event-driven stateful stores, lazy derived state with automatic dependency tracking, glitch-free reactivity, and hierarchical scope-based lifecycle management.

2.0.0 #

  • Event binding: passing an Event<T> in scope overrides binds it to that scope; fire() from the owning scope or any descendant broadcasts through the entire subtree, enabling global and semi-global event routing
  • Unbound events default to root: unbound events broadcast from the root scope, consistent with how unbound stores are globally accessible; bind an event to an intermediate scope to restrict its broadcast to that subtree
  • Automatic scope promotion: derived stores are now placed in the deepest scope that owns their dependencies rather than the requesting scope, so all reads within a subtree share one instance
  • Constant derived stores live on root: derived stores with no dependencies are promoted to the root scope, consistent with unbound accum stores
  • Event<T> now implements StoreOverride (extracted to override.dart to avoid circular imports)

1.0.0 #

Initial release.

  • Store<S, E> — reactive state machine with pure update function and explicit effect streams
  • Stateful<S> — lazy derived reactive value with automatic dependency tracking via Snapshot
  • Scope — runtime that manages the reactive graph, dispatches events, executes effects, and controls store lifecycles
  • StoreOverride — transparent store replacement for dependency injection and testing
  • Scope forking for hierarchical store lifetime management
  • External stream subscriptions via Store's subscribe parameter
  • Glitch-free update compression: every Stateful node recomputes at most once per event cycle regardless of how many upstream dependencies changed
0
likes
140
points
102
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A reactive microstore for Dart. Event-driven stateful stores, lazy derived state with automatic dependency tracking, glitch-free reactivity, and hierarchical scope-based lifecycle management.

Repository (GitHub)
View/report issues

Topics

#state-management #reactive #store

License

MIT (license)

Dependencies

meta

More

Packages that depend on caffeine