UiStateEntry<T> Class

A single UI State entry that is identified by namespace and setting name.

Methods

Name Description
constructor<T>(settingNamespace: string, settingName: string, getValue: () => T, applyValue?: (v: T) => void, defaultValue?: T): UiStateEntry<T> Constructor  
deleteSetting(storage: UiStateStorage): Promise<UiStateStorageResult> Deletes the setting from UiStateStorage  
getSetting(storage: UiStateStorage): Promise<UiStateStorageResult> Gets the setting from UiStateStorage  
getSettingAndApplyValue(storage: UiStateStorage): Promise<UiStateStorageResult> Gets the setting from UiStateStorage and applies the value using the applyValue function  
saveSetting(storage: UiStateStorage): Promise<UiStateStorageResult> Saves the setting value from the getValue function to UiStateStorage  

Properties

Name Type Description
applyValue undefined | (v: T) => void    
defaultValue undefined | T Optional default value if not already stored.  
getValue () => T    
settingName string Name for the setting, passed to UiStateStorage.  
settingNamespace string Namespace for the setting, passed to UiStateStorage.  

Defined in

Last Updated: 21 March, 2024