Skip to content

Function: transaction()

ts
function transaction<T>(action: () => T, thisArg?: undefined): T;

Defined in: mobx:

During a transaction no views are updated until the end of the transaction. The transaction will be run synchronously nonetheless.

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
action() => Ta function that updates some reactive state
thisArg?undefined-

Returns

T

any value that was returned by the 'action' parameter.