new Preferences(preferencesArray)
Creates a configuration object based on preferences.
This means we use localStorage to interact with the components.
Parameters:
Name | Type | Description |
---|---|---|
preferencesArray |
array | the preferences that we want to sync with the local storage |
- Source:
Example
const preferencesArray = [{
key: 'runDetails.logView',
defaultValue: 'pipeline',
allowedValues: ['classic', 'pipeline'],
},
{
key: 'runDetails.pipeline.updateOnFinish',
defaultValue: 'default',
allowedValues: ['default', 'never'],
},
{
key: 'runDetails.pipeline.showPending',
defaultValue: 'default',
allowedValues: ['default', 'never'],
},
{
key: 'runDetails.pipeline.karaoke',
defaultValue: 'default',
allowedValues: ['default', 'never'],
},
];
const karaokeConfig = preferences.newPreferences(preferencesArray);
Methods
getKeys() → {array}
Returns all registered keys
- Source:
Returns:
- Type
- array
getPreference(key) → {Preference}
Get the preference representation of the key
Parameters:
Name | Type | Description |
---|---|---|
key |
string | the lookup key |
- Source:
Returns:
- Type
- Preference