🚀 Pandora v3.5.0 - Major API Improvements
Breaking Changes
Publisher API Simplification
- Removed
emitInitialparameter from allpublisher(for:)methods - Publishers now always emit current value immediately
- Use
.dropFirst()to skip current value
// Before
cache.publisher(for: "key", emitInitial: false)
// After
cache.publisher(for: "key").dropFirst()Consistent Clearing API
- HybridBox & UserDefaultsBox:
clear()methods now async - New namespace clearing:
Pandora.clearUserDefaults(for:)andPandora.clearDiskData(for:) - Safer global clearing:
clearAllUserDefaults()only clears Pandora keys
// New API
memoryCache.clear() // Sync
await diskCache.clear() // Async
await hybridCache.clear() // Async
await userDefaultsCache.clear() // Async
// Namespace-specific
Pandora.clearUserDefaults(for: "settings")
Pandora.clearDiskData(for: "cache")New Features
- Namespace-specific clearing: Clear specific namespaces without affecting others
- UI-friendly publishers: Subscriptions persist when items are removed/re-added
- Simplified API: No more confusing
emitInitialparameter
Improvements
- Test optimization: 128 tests (down from 150+) while maintaining 99%+ coverage
- Consolidated tests: Merged duplicate factory method tests
- Better performance: Optimized publisher implementation
- Enhanced documentation: Updated README with new examples
Migration
// Publisher API
cache.publisher(for: "key", emitInitial: true) → cache.publisher(for: "key")
cache.publisher(for: "key", emitInitial: false) → cache.publisher(for: "key").dropFirst()
// Clearing API
box.clear() → await box.clear() // For HybridBox & UserDefaultsBoxStats
- Tests: 128 (99%+ coverage)
- Breaking Changes: 2 major API changes
- New Methods: 2 namespace-specific clearing methods
Full Changelog: 3.4.0...3.5.0