File

libs/upp-base/src/modules/localcfg.ts

Description

Represents a single configuration element, allowing for data manipulation and persistence.

Index

Properties
Methods
Accessors

Constructor

constructor(element: string, config: _ConfigStorage)

Initializes the Configuration instance and loads existing data for the element.

Parameters :
Name Type Optional Description
element string No
  • The name of the configuration element.
config _ConfigStorage No
  • The storage service to use for persisting data.

Properties

Public OnUpdated
Default value : this._onUpdated.asObservable()

An observable that emits whenever the configuration is updated. Consumers can subscribe to react to updates.

Methods

commit
commit()

Saves all current configuration data to storage.

Returns : void
get
get(item: string)

Retrieves the value of a specific configuration key.

Parameters :
Name Type Optional Description
item string No
  • The name of the configuration key.
Returns : ConfigValue

The value associated with the key, or undefined if it does not exist.

set
set(item: string, value: ConfigValue)

Sets the value of a specific configuration key. If the value is null, the key is removed from the configuration.

Parameters :
Name Type Optional Description
item string No
  • The name of the configuration key.
value ConfigValue No
  • The value to assign to the key, or null to remove it.
Returns : void

Accessors

autoCommit
getautoCommit()

Gets the autoCommit status.

Returns : boolean
setautoCommit(value: boolean)

Sets the autoCommit status.

Parameters :
Name Type Optional Description
value boolean No
  • true to enable automatic saving of changes, false otherwise.
Returns : void

results matching ""

    No results matching ""