new UserDataStoreNamespace()
Properties:
Name | Type | Description |
---|---|---|
keys |
array | an array of the loaded keys. |
namespace |
string | Name of the namespace as on the server. |
Represents a namespace in the dataStore that can be used to be used to interact with the remote API.
Extends
Members
keys :Array.<string>
- Source:
- Inherited From:
an array of the loaded keys.
Type:
- Array.<string>
namespace :string
- Source:
- Inherited From:
The name of the namespace
Type:
- string
Methods
delete(key) → {Promise}
- Source:
- Inherited From:
Deletes given key from the API.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | key to delete. |
Returns:
- the response body from the API.
- Type
- Promise
get(key) → {Promise}
- Source:
- Inherited From:
Retrieves the value of given key in current namespace.
Parameters:
Name | Type | Description |
---|---|---|
key |
key to retrieve. |
Returns:
- The value of the given key.
- Type
- Promise
getKeys() → {Promise}
- Source:
- Inherited From:
Get the keys for this namespace.
Returns:
- The internal list of keys for current namespace.
- Type
- Promise
set(key, value, overrideUpdateopt, encryptopt) → {Promise}
- Source:
- Inherited From:
Sets the value of given key to given value.
This will also create a new namespace on the API-end if it does not exist.
If the key exists update will be called, unless overrideUpdate
equals
true.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
key |
key in this namespace to set. |
|||
value |
JSON-value to be set. |
|||
overrideUpdate |
<optional> |
false
|
If true a post-request is sent even if key exists. |
|
encrypt |
<optional> |
false
|
If the value should be encrypted on the server. |
Returns:
- the response body from the API.
- Type
- Promise
update(key, value) → {Promise}
- Source:
- Inherited From:
Updates a key with given value.
Parameters:
Name | Type | Description |
---|---|---|
key |
key to update. |
|
value |
value to update to. |
Returns:
- the response body from the API.
- Type
- Promise