Tincan
Overview
A fine-grained reactive state management library for Rust.
Tincan provides two levels of abstraction for building reactive applications:
- Signals: Low-level reactive primitives with automatic dependency tracking
- Store: High-level state management for complex application state
Core Concepts
- Signal: A reactive value that notifies dependents when changed
- Memo: A cached computed value that only recalculates when dependencies change
- Effect: A side effect that automatically runs when dependencies change
- Store: A container for complex state with automatic change notifications
Quick Start
Signals (Low-level API)
use ;
// Create a reactive signal
let = create_signal;
// Create a derived value
let doubled = create_memo;
// Create a side effect
create_effect;
// Update the signal (triggers effect automatically)
set_count.set;
Store (High-level API)
use Store;
// Create a store
let store = new;
// Subscribe to changes
store.subscribe;
// Update state
store.update;
Examples
Run the included examples:
# Basic signal usage
# Store with complex state
# Derived values with memos
Benchmarks
Run performance benchmarks: