Skip to main content

UnifiedStateManager

FitFileViewer - API Documentation v29.4.0


FitFileViewer - API Documentation / utils/state/core/unifiedStateManager / UnifiedStateManager

Class: UnifiedStateManager

Defined in: utils/state/core/unifiedStateManager.js:33

Unified State Manager - Single interface for all state systems Provides consistency during migration from legacy to new state management

Constructors​

Constructor​

new UnifiedStateManager(): UnifiedStateManager

Defined in: utils/state/core/unifiedStateManager.js:34

Returns​

UnifiedStateManager

Properties​

legacyWarningsShown​

legacyWarningsShown: Set<any>

Defined in: utils/state/core/unifiedStateManager.js:35


syncEnabled​

syncEnabled: boolean

Defined in: utils/state/core/unifiedStateManager.js:36


debugMode​

debugMode: boolean

Defined in: utils/state/core/unifiedStateManager.js:37

Methods​

disableDebugMode()​

disableDebugMode(): void

Defined in: utils/state/core/unifiedStateManager.js:43

Disable debug mode

Returns​

void


enableDebugMode()​

enableDebugMode(): void

Defined in: utils/state/core/unifiedStateManager.js:50

Enable debug mode for state management

Returns​

void


get()​

get(path: string, defaultValue?: any): any

Defined in: utils/state/core/unifiedStateManager.js:61

Get state value with unified interface

Parameters​

path​

string

State path (dot notation)

defaultValue?​

any

Default value if not found

Returns​

any

State value


getLegacyState()​

private getLegacyState(path: string, defaultValue: any): any

Defined in: utils/state/core/unifiedStateManager.js:82

Get legacy state with fallback handling

Parameters​

path​

string

State path

defaultValue​

any

Default value

Returns​

any

State value


getSnapshot()​

getSnapshot(): Object

Defined in: utils/state/core/unifiedStateManager.js:108

Get current state snapshot for debugging

Returns​

Object

State snapshot


isLegacyPath()​

isLegacyPath(path: string): boolean

Defined in: utils/state/core/unifiedStateManager.js:123

Check if a path belongs to legacy state system

Parameters​

path​

string

State path to check

Returns​

boolean

True if legacy path


set()​

set(path: string, value: any, options?: UnifiedStateOptions): void

Defined in: utils/state/core/unifiedStateManager.js:134

Set state value with unified interface

Parameters​

path​

string

State path (dot notation)

value​

any

Value to set

options?​

UnifiedStateOptions = {}

Set options

Returns​

void


setLegacyState()​

private setLegacyState(path: string, value: any, _options: UnifiedStateOptions): void

Defined in: utils/state/core/unifiedStateManager.js:169

Set legacy state with fallback handling

Parameters​

path​

string

State path

value​

any

Value to set *

_options​

UnifiedStateOptions

Set options (currently unused)

Returns​

void


setSyncEnabled()​

setSyncEnabled(enabled: boolean): void

Defined in: utils/state/core/unifiedStateManager.js:191

Enable or disable legacy system synchronization

Parameters​

enabled​

boolean

Whether to enable sync

Returns​

void


subscribe()​

subscribe(path: string, callback: Function): Function

Defined in: utils/state/core/unifiedStateManager.js:204

Subscribe to state changes with unified interface

Parameters​

path​

string

State path to watch (* for all)

callback​

Function

Callback function

Returns​

Function

Unsubscribe function


validateConsistency()​

validateConsistency(): Object

Defined in: utils/state/core/unifiedStateManager.js:217

Validate state consistency across systems

Returns​

Object

Validation results