mirror of
https://github.com/FranP-code/Baileys.git
synced 2025-10-13 00:32:22 +00:00
docs: add info about addTransactionCapability
This commit is contained in:
@@ -15,6 +15,13 @@ const KEY_MAP: { [T in keyof SignalDataTypeMap]: string } = {
|
||||
'sender-key-memory': 'senderKeyMemory'
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds DB like transaction capability (https://en.wikipedia.org/wiki/Database_transaction) to the SignalKeyStore,
|
||||
* this allows batch read & write operations & improves the performance of the lib
|
||||
* @param state the key store to apply this capability to
|
||||
* @param logger logger to log events
|
||||
* @returns SignalKeyStore with transaction capability
|
||||
*/
|
||||
export const addTransactionCapability = (state: SignalKeyStore, logger: Logger): SignalKeyStoreWithTransaction => {
|
||||
let inTransaction = false
|
||||
let transactionCache: SignalDataSet = { }
|
||||
|
||||
Reference in New Issue
Block a user