RTKStore
This module represents a single global store.
The store can be accessed from the meeting.stores module.
Returns: An instance of RTKStore.
Example
const handRaiseRTKStore = meeting.stores.stores.get('handRaise');- RTKStore ⇒
- module.exports ⏏
- new module.exports(args)
- .set(key, value, [sync], [emit]) ⇒
Promise.<void> - .bulkSet(data) ⇒
Promise.<void> - .update(key, value, [sync]) ⇒
Promise.<void> - .delete(key, [sync], [emit]) ⇒
Promise.<void> - .bulkDelete(data) ⇒
Promise.<void> - .get(key) ⇒
any - .getAll() ⇒
RTKStoreData - .updateRateLimits(num, period)
- .updateBulkRateLimits(num, period)
- .subscribe(key, cb) ⇒
void - .unsubscribe(key, [cb]) ⇒
void - .populate(data)
- module.exports ⏏
| Param | Type |
|---|---|
| args | Object |
| args.name | string |
| args.socketHandler | PluginSocketHandler |
| args.meetingId | string |
Sets a value in the store.
Kind: instance method of module.exports
Returns: Promise.<void> - A promise.
| Param | Type | Default | Description |
|---|---|---|---|
| key | string | Unique identifier used to store value. | |
| value | any | Data to be set. | |
| [sync] | boolean | true | Whether to sync change to remote store. |
| [emit] | boolean | false | Whether to emit to local subscribers. |
Sets multiple values in the store.
Kind: instance method of module.exports
Returns: Promise.<void> - A promise.
| Param | Type |
|---|---|
| data | Array.<{key: string, payload: any}> |
Updates an already existing value in the store.
If the value stored is ['a', 'b'], the operation
store.update(key, ['c']) will modify
the value to ['a','b','c'].
Kind: instance method of module.exports
Returns: Promise.<void> - A promise.
| Param | Type | Default | Description |
|---|---|---|---|
| key | string | Unique identifier used to store value. | |
| value | any | Data to be updated. | |
| [sync] | boolean | true | Whether to sync change to remote store. |
Deletes a key value pair form the store.
Kind: instance method of module.exports
Returns: Promise.<void> - A promise.
| Param | Type | Default | Description |
|---|---|---|---|
| key | string | Unique identifier used to store value. | |
| [sync] | boolean | true | Whether to sync change to remote store. |
| [emit] | boolean | false | Whether to emit to local subscribers. |
Deletes multiple values from the store.
Kind: instance method of module.exports
Returns: Promise.<void> - A promise.
| Param | Type |
|---|---|
| data | Array.<{key: string}> |
Returns value for the given key.
Kind: instance method of module.exports
Returns: any - Value for the given key.
| Param | Type | Description |
|---|---|---|
| key | string | Unique identifier used to store value. |
Returns the entire store.
Kind: instance method of module.exports
Returns: RTKStoreData - An instance of RTKStoreData.
Kind: instance method of module.exports
| Param | Type |
|---|---|
| num | number |
| period | number |
Kind: instance method of module.exports
| Param | Type |
|---|---|
| num | number |
| period | number |
Listens for data change on a store key.
Kind: instance method of module.exports
Returns: void - void
| Param | Type | Description |
|---|---|---|
| key | string | Unique identifier used to store value. |
| cb | function | The callback function that gets executed when data is modified. |
Removes all listeners for a key on the store.
Kind: instance method of module.exports
Returns: void - void
| Param | Type | Description |
|---|---|---|
| key | string | Unique identifier used to store value. |
| [cb] | function | Callback to be removed. |
Kind: instance method of module.exports
| Param | Type |
|---|---|
| data | RTKStoreData |