react / runOnBackground

Function: runOnBackground()

function runOnBackground<Fn>(f: Fn): (...args: Parameters<Fn>) => void

runOnBackground allows triggering js functions on the js context asynchronously.

Type Parameters

Type Parameter
Fn extends (...args: any[]) => any

Parameters

Parameter Type Description
f Fn The js function to be called.

Returns

Function

A function. Calling which with the arguments to be passed to the js function to trigger it on the js context.

Parameters

Parameter Type
...args Parameters<Fn>

Returns

void

Defined in

@lynx-js/react/runtime/lib/worklet/runWorklet.d.ts:14

Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.