MCPcopy
hub / github.com/tinyplex/tinybase / transaction

Function transaction

src/store/index.ts:1898–1910  ·  view source on GitHub ↗
(
    actions: () => Return,
    doRollback?: DoRollback,
    // eslint-disable-next-line @typescript-eslint/ban-ts-comment
    // @ts-ignore void return only occurs internally
  )

Source from the content-addressed store, hash-verified

1896 });
1897
1898 const transaction = <Return>(
1899 actions: () => Return,
1900 doRollback?: DoRollback,
1901 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1902 // @ts-ignore void return only occurs internally
1903 ): Return => {
1904 if (transactions != -1) {
1905 startTransaction();
1906 const result = actions();
1907 finishTransaction(doRollback);
1908 return result as Return;
1909 }
1910 };
1911
1912 const startTransaction = (): Store => {
1913 if (transactions != -1) {

Callers 2

fluentTransactionFunction · 0.70
addRowFunction · 0.70

Calls 3

actionsFunction · 0.85
startTransactionFunction · 0.70
finishTransactionFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…