Skip to content

Commit 433fcd0

Browse files
fix:comments
1 parent d87d9c7 commit 433fcd0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/docs-worklets/docs/threading/runOnRuntimeAsync.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
sidebar_position: 42 # Use alphabetical order
33
---
44

5-
# runOnRuntimeAsync
5+
# runOnRuntimeAsync <AvailableFrom version="0.8.0"/>
66

7-
`runOnRuntimeAsync` lets you asynchronously run [workletized](/docs/fundamentals/glossary#to-workletize) functions on a [Worker Runtime](/docs/fundamentals/runtimeKinds#worker-runtime).
7+
`runOnRuntimeAsync` lets you asynchronously run [worklets](/docs/fundamentals/glossary#worklet) on a [Worker Runtime](/docs/fundamentals/runtimeKinds#worker-runtime).
88
It returns a Promise of the worklet's return value. The Promise is resolved asynchronously, not immediately after the callback execution.
99

1010
## Reference
@@ -16,12 +16,12 @@ const workletRuntime = createWorkletRuntime({ name: 'background' });
1616

1717
// RN Runtime, JS thread
1818

19-
const result: Promise<number> = await runOnRuntimeAsync(workletRuntime, (): number => {
19+
const result: Promise<number> = runOnRuntimeAsync(workletRuntime, (): number => {
2020
'worklet';
2121
return 2 + 2;
2222
});
2323

24-
result; // 4
24+
await result; // 4
2525
```
2626

2727
<details>

0 commit comments

Comments
 (0)