From c5d488f1c6f596c5ff35b4a847acf42d6481db6a Mon Sep 17 00:00:00 2001 From: Adhiraj Singh Date: Sun, 22 May 2022 20:41:00 +0530 Subject: [PATCH] docs: add info about addTransactionCapability --- src/Utils/auth-utils.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Utils/auth-utils.ts b/src/Utils/auth-utils.ts index 5ac031a..a5cb8c8 100644 --- a/src/Utils/auth-utils.ts +++ b/src/Utils/auth-utils.ts @@ -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 = { }