MCPcopy
hub / github.com/mobxjs/mobx / transaction

Function transaction

packages/mobx/src/api/transaction.ts:10–17  ·  view source on GitHub ↗
(action: () => T, thisArg = undefined)

Source from the content-addressed store, hash-verified

8 * @returns any value that was returned by the 'action' parameter.
9 */
10export function transaction<T>(action: () => T, thisArg = undefined): T {
11 startBatch()
12 try {
13 return action.apply(thisArg)
14 } finally {
15 endBatch()
16 }
17}

Callers 15

observer.test.tsxFile · 0.90
flipStuffFunction · 0.90
setActiveStepFunction · 0.90
changeStuffFunction · 0.90
babel-tests.jsFile · 0.90
deleteMethod · 0.50
addValue_Method · 0.50

Calls 2

startBatchFunction · 0.85
endBatchFunction · 0.85

Tested by 3

flipStuffFunction · 0.72
setActiveStepFunction · 0.72
changeStuffFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…