Flash Persistence
Ecosistema completo para organización y gestión de contenido con interfaces espaciales
Flash Persistence
Auto-persistent Angular signals that combine the power of Angular's reactive primitives with automatic, intelligent storage.
What is Flash Persistence?
Flash Persistence provides signals that automatically persist their state to storage, with:
- ⚡ Instant reads (0.3ms from cache)
- 🔄 Automatic persistence (save on every change)
- 🧠 Intelligent storage (adapters chosen automatically)
- 🎯 Type-safe (full TypeScript support)
- 🔌 Optional sync (MongoDB, Firebase, API)
Documentation
- 📖 Overview - Architecture and concepts
- 🚀 Quick Start - Get started in 5 minutes
- 🎯 Component Integration - Using in components
- 📚 API Reference - Complete API documentation
- 🎓 Best Practices - Patterns and recommendations
- 🔧 Advanced Usage - Custom configurations and optimization
Quick Example
import { autoFlashState } from '@storage-system';
// Create a persistent signal
const userPrefs = autoFlashState({
key: 'preferences',
initialValue: { theme: 'dark', language: 'en' },
priority: 'high' // Sync every 5 minutes if MongoDB enabled
});
// Use like any signal
const theme = userPrefs().theme;
// Update - automatically persists
userPrefs.set({ theme: 'light', language: 'es' });
// Updates are instant (0.3ms cache) + background persistence
Key Features
Automatic Persistence
- Saves on every change
- Debounced writes (configurable)
- No manual save() calls needed
Intelligent Storage
- Adapters chosen automatically
- Redundancy for critical data
- TTL support for temporary data
MongoDB Sync (Optional)
- Offline-first by default
- Configurable sync strategies
- Priority-based synchronization
Type Safety
- Full TypeScript support
- Generic types for values
- Compile-time safety
Use Cases
- User Preferences: Theme, language, settings
- App State: UI state, selections, filters
- Form Data: Auto-save drafts
- Cache: API responses, computed values
- Multi-Device: Sync via MongoDB
- Offline-First: Works without internet