settings
Interface for handling settings and properties stored in localStorage
get(namespace, key, [defaultValue]) ⇒ *
*
Get a value for a specific setting. Return null, or default value when specified when not existing.
Parameters
Param
Type
Default
Description
namespace
String
Required - Plugin name, or namespace of saved setting value
key
String
Required - Key where setting is saved
defaultValue
*
null
Default return value if key is not found in namespace
set(namespace, key, value) ⇒ boolean
boolean
Set a value for a specific setting, transformed into JSON. Returns true on success, false on failure.
Parameters
Param
Type
Description
namespace
String
Required - Plugin name or custom namespace where to save setting
key
String
Required - Which key to use to save setting value
value
*
Required - Value of setting
delete(namespace, key) ⇒ boolean
boolean
Delete a specific setting. Returns true on success, false on failure.
Parameters
Param
Type
namespace
String
key
String
getAllSettings(namespace) ⇒ *
*
Retrieve all settings stored. Returns false on failure, object on success.
Parameters
Param
Type
Description
namespace
String
Required - Plugin name or custom namespace where to save setting
Last updated