Skip to main content

Function: runUnprotected()

Call Signature​

function runUnprotected<T>(name, fn): T;

Runs a block in unprotected mode, as if it were run inside a model action. Structural mutations share one synchronous mutation batch, but the block is not recorded as an action. Consider using a proper model action when action recording is needed.

Type Parameters​

Type ParameterDescription
TReturn type.

Parameters​

ParameterTypeDescription
namestringMobx action name.
fn() => TAction block.

Returns​

T

Call Signature​

function runUnprotected<T>(fn): T;

Runs a block in unprotected mode, as if it were run inside a model action. Structural mutations share one synchronous mutation batch, but the block is not recorded as an action. Consider using a proper model action when action recording is needed.

Type Parameters​

Type ParameterDescription
TReturn type.

Parameters​

ParameterTypeDescription
fn() => TAction block.

Returns​

T