Data Layer & Caching
Bloom Data brings TanStack Query semantics to Flutter with a zero-cost Fine-Grained Signals reactivity model, automatic SWR caching, in-flight deduplication, and native SQLite offline persistence.
Bloom Data vs. TanStack Query (React Query)
While TanStack Query relies on React component-level hook reruns and JavaScript runtime type erasure, Bloom Data is built on compile-time Dart generics, zero-rebuild Signals, and integrated mobile offline persistence:
| Feature | Bloom Data (Flutter) | TanStack Query (React / JS) |
|---|---|---|
| Reactivity Engine | Fine-Grained Signals (0 full widget rebuilds) | Component Hooks (Entire component re-runs) |
| Type Safety | Compile-Time Reified Dart Generics | TypeScript (Erased at runtime) |
| Bulk Cache Writes | 84 ms (119k ops/sec) 🥇 | 132 ms (75k ops/sec) |
| In-Flight Deduplication | 23 ms resolution (1k calls / 50 keys) 🥇 | 34 ms resolution |
| Offline Persistence | Native SQLite & SecureStorage adapter | Requires external persist plugins |
| Realtime Invalidation | Native RealtimeQueryBridge | Manual socket.on boilerplate wiring |
Declarative Queries (SWR)
Define queries inside your controller with declarative stale and garbage collection timeouts:
Optimistic Mutations & Rollback
Mutate server state optimistically for instantaneous user feedback with safe automatic rollback if network requests fail:
Fine-Grained Signals Reactivity
Wrap only the leaf UI nodes with Watch. Unlike React hooks, parent layouts and sibling widgets never re-render when query signals update:
Native Realtime Query Bridge
Connect channel broadcasts directly to query cache invalidation. When the server pushes an event, Bloom automatically schedules a background revalidation: