StatePersistence Service
File: src/services/StatePersistence.ts
Overview
Exports
- statePersistence - const export
Classes
StatePersistenceService
No description available.
Methods:
initialize_initializestatecatchloadStateupdateLastActiveTimestampsaveStatedebouncedSaveforceSavecleanupclearOldStatessetLastServergetLastServersetLastChannelgetLastChannelsetCategoryCollapseStategetCategoryCollapseStategetServerCategoryStatesbatchUpdateCategoryStatessetSidebarStategetSidebarStatesetAppInitializedisAppInitializedsetHasServersshouldShowNoServersSplashisCurrentlyRestoringsetRestorationCompleteclearStateexportStateimportStateperformHealthCheck
Properties:
stateappStateisLoadedloadingPromiseFIXsaveTimeoutpendingSavemigrationstoredparsedneededhasInitializedhasServersshouldShowSplashisRestoringtruedefaultstimestamphandlingstateToSavelastActiveTimestamponcecleanupwritefalseinitializationnullchangestimeoutsspacekeysToRemoveikeyvalidationserverIdsavedserverchannelIdbatchingcategoryIdcollapsedwritescategoryserverStatesperformancecategoryStatesvisiblestatessidebarflashbooleaninitializedFallbackmanagementvalueconfirmationkeyspersistedruntimevalidatedStateintegrityisHealthyissuesavailablestructure
Interfaces
PersistedState
No description available.
typescript
interface PersistedState {
lastServerId: string | null
lastChannelByServer: Record<string, string>
categoryCollapseStates: Record<string, Record<string, boolean>>
sidebarStates: {
leftSidebarVisible: boolean
rightSidebarVisible: boolean
}
appInitialized: boolean
uiPreferences: {
theme: string
fontSize: number
enableAnimations: boolean
}
lastActiveTimestamp: number
}CategoryCollapseState
No description available.
typescript
interface CategoryCollapseState {
[categoryId: string]: boolean
}ApplicationState
No description available.
typescript
interface ApplicationState {
hasInitialized: boolean
hasServers: boolean
shouldShowSplash: boolean
isRestoring: boolean
}Constants
STORAGE_KEY
No description available.
typescript
const STORAGE_KEY = 'app-state' // Will be prefixed with user ID by userStorageSTATE_VERSION
No description available.
typescript
const STATE_VERSION = '1.2.0'DEFAULT_STATE
No description available.
typescript
const DEFAULT_STATE: PersistedState = {DEFAULT_APP_STATE
No description available.
typescript
const DEFAULT_APP_STATE: ApplicationState = {Source Code Insights
File Size: 14735 characters Lines of Code: 535 Imports: 2
Usage Example
typescript
import { statePersistence } from '@/services/StatePersistence'
// Example usage
// Use the exported functionalityThis documentation was automatically generated from the source code.
