Refactor offline-first architecture with IndexedDB

Improves dependency injection and service initialization for IndexedDB-based calendar application

Implements lazy initialization for IndexedDB
Fixes race conditions in async event handling
Adds proper dependency injection with registerType
Enhances sync manager and repository pattern

Key improvements:
- Lazy database initialization
- Proper service lifecycle management
- Improved network awareness for sync operations
- Cleaned up initialization logic in index.ts
This commit is contained in:
Janus C. H. Knudsen 2025-11-05 20:35:21 +01:00
parent e7011526e3
commit a1bee99d8e
6 changed files with 226 additions and 34 deletions

View file

@ -40,6 +40,8 @@ export class SyncManager {
this.apiRepository = apiRepository;
this.setupNetworkListeners();
this.startSync();
console.log('SyncManager initialized and started');
}
/**