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 (v: T) => void | undefined Function for applying the setting value to the application.  
defaultValue T | undefined Optional default value if not already stored.  
getValue () => T Function for getting the value from the application.  
settingName string Name for the setting, passed to UiStateStorage.  
settingNamespace string Namespace for the setting, passed to UiStateStorage.  

Defined in

Last Updated: 17 December, 2024