Recipes
Practical patterns that show how to solve real problems with callbag-recharge. Each recipe is a self-contained example you can copy into your project.
Orchestration
| Recipe | What it shows |
|---|---|
| Airflow-Style Pipeline | pipeline + step + gate + route for declarative DAG workflows with retry, circuit breakers, and checkpointing |
| Cron Pipeline | fromCron + exhaustMap + fromPromise for scheduled pipelines |
Streaming & Async
| Recipe | What it shows |
|---|---|
| AI Chat with Streaming | producer + switchMap + scan for streaming LLM responses with auto-cancellation |
| Reactive Data Pipeline | fromIter/fromAsyncIter + pipe operators for streaming ETL |
| Real-Time Dashboard | state + derived + batch for diamond-safe metrics |
Edge AI & LLM
| Recipe | What it shows |
|---|---|
| On-Device LLM Streaming | fromAbortable + switchMap for Ollama/WebLLM token streams with auto-cancel |
| Hybrid Cloud+Edge Routing | Confidence-based routing between local and cloud LLMs with fallback |
| Tool Calls for Local LLMs | Reactive state machine for tool call lifecycle |
State Management
| Recipe | What it shows |
|---|---|
| createStore (Zustand Migration) | Zustand-compatible API with diamond-safe selectors and push-phase memoization |
Migration Guides
| Guide | What it covers |
|---|---|
| From Zustand | Drop-in compat layer + native API migration |
| From Jotai | atom() compat + diamond resolution benefits |
| From Nanostores | atom/computed/map compat + per-key reactivity via reactiveMap |