Skip to content
Cloudflare Docs

RTKStore

This module represents a single global store. The store can be accessed from the meeting.stores module.

Returns: An instance of RTKStore.
Example

JavaScript
const handRaiseRTKStore = meeting.stores.stores.get('handRaise');

module.exports ⏏

Kind: Exported class

new module.exports(args)

ParamType
argsObject
args.namestring
args.socketHandlerPluginSocketHandler
args.meetingIdstring

module.exports.set(key, value, [sync], [emit]) ⇒ Promise.<void>

Sets a value in the store.

Kind: instance method of module.exports
Returns: Promise.<void> - A promise.

ParamTypeDefaultDescription
keystringUnique identifier used to store value.
valueanyData to be set.
[sync]booleantrueWhether to sync change to remote store.
[emit]booleanfalseWhether to emit to local subscribers.

module.exports.bulkSet(data) ⇒ Promise.<void>

Sets multiple values in the store.

Kind: instance method of module.exports
Returns: Promise.<void> - A promise.

ParamType
dataArray.<{key: string, payload: any}>

module.exports.update(key, value, [sync]) ⇒ Promise.<void>

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.

ParamTypeDefaultDescription
keystringUnique identifier used to store value.
valueanyData to be updated.
[sync]booleantrueWhether to sync change to remote store.

module.exports.delete(key, [sync], [emit]) ⇒ Promise.<void>

Deletes a key value pair form the store.

Kind: instance method of module.exports
Returns: Promise.<void> - A promise.

ParamTypeDefaultDescription
keystringUnique identifier used to store value.
[sync]booleantrueWhether to sync change to remote store.
[emit]booleanfalseWhether to emit to local subscribers.

module.exports.bulkDelete(data) ⇒ Promise.<void>

Deletes multiple values from the store.

Kind: instance method of module.exports
Returns: Promise.<void> - A promise.

ParamType
dataArray.<{key: string}>

module.exports.get(key) ⇒ any

Returns value for the given key.

Kind: instance method of module.exports
Returns: any - Value for the given key.

ParamTypeDescription
keystringUnique identifier used to store value.

module.exports.getAll() ⇒ RTKStoreData

Returns the entire store.

Kind: instance method of module.exports
Returns: RTKStoreData - An instance of RTKStoreData.

module.exports.updateRateLimits(num, period)

Kind: instance method of module.exports

ParamType
numnumber
periodnumber

module.exports.updateBulkRateLimits(num, period)

Kind: instance method of module.exports

ParamType
numnumber
periodnumber

module.exports.subscribe(key, cb) ⇒ void

Listens for data change on a store key.

Kind: instance method of module.exports
Returns: void - void

ParamTypeDescription
keystringUnique identifier used to store value.
cbfunctionThe callback function that gets executed when data is modified.

module.exports.unsubscribe(key, [cb]) ⇒ void

Removes all listeners for a key on the store.

Kind: instance method of module.exports
Returns: void - void

ParamTypeDescription
keystringUnique identifier used to store value.
[cb]functionCallback to be removed.

module.exports.populate(data)

Kind: instance method of module.exports

ParamType
dataRTKStoreData