vue-lynx / runOnBackground

Function: runOnBackground()

function runOnBackground<R, Fn>(_fn): (...args) => Promise<R>

Call a Background Thread function from a 'main thread' worklet.

At build time the SWC transform replaces all runOnBackground(fn) call sites. This export exists only for TypeScript import resolution — it is never called at runtime on the BG thread.

Type Parameters

Type Parameter
R
Fn extends (...args) => R

Parameters

ParameterType
_fnFn

Returns

Function

Parameters

ParameterType
...argsParameters<Fn>

Returns

Promise<R>

Defined in

packages/vue-lynx/runtime/src/run-on-background.ts:141