new RemoteUser(identifier, dataopt)
Construct a new Remote user.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
identifier |
string | The unique ID for this user. | |
data |
Object |
<optional> |
The serialized key-value data object to assign to this user. |
- Source:
Throws:
If identifier is not supplied.
Methods
get(key) → {*}
Get the data value for the given key.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | An arbitrary bridge-specific key. |
- Source:
Returns:
Stored data for this key. May be undefined.
- Type
- *
getId() → {string}
Get the Remote user's ID.
- Source:
Returns:
Their ID.
- Type
- string
serialize() → {Object}
Serialize all the data about this user, excluding their remote ID.
- Source:
Returns:
The serialised data
- Type
- Object
set(key, val)
Set an arbitrary bridge-specific data value for this user.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The key to store the data value under. |
val |
* | The data value. This value should be serializable via
JSON.stringify(data) . |
- Source: