sf-preferences
v1.0.5
Published
Library to easily manage SimpliField preferences.
Downloads
460
Readme
sf-preferences
Easily manage SimpliField preferences.
API
Functions
sf-preferences
query(name, fallbackValue, ...preferences) ⇒ String | Boolean | Number
Query several preferences sets for a given name
Kind: global function
Returns: String | Boolean | Number - The resolved value
| Param | Type | Description | | --- | --- | --- | | name | String | The preference name to query for. | | fallbackValue | String | Boolean | Number | The default value to fallback to. | | ...preferences | Array | The preferences set in wich to look for |
get(preferences, name) ⇒ String | Boolean | Number
Get the value for a preference name in the given preferences set
Kind: global function
Returns: String | Boolean | Number - The value to set to.
| Param | Type | Description | | --- | --- | --- | | preferences | Array | The preferences set to search in | | name | String | The preference name. |
set(preferences, name, value) ⇒ Array
Set the preference name to the given value in the given preferences set
Kind: global function
Returns: Array - The modified preferences set
| Param | Type | Description | | --- | --- | --- | | preferences | Array | The preferences set to modify | | name | String | The preference name to set. | | value | String | Boolean | Number | The value to set to. |