Skip to content

Commit f2db8cf

Browse files
docs: Clarify what makes await available
1 parent b0c4f7b commit f2db8cf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/cheat_sheet.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ end
124124

125125
### `await` JavaScript `Promise` from Ruby
126126

127+
`data-eval="async"` attribute is required to use `await` in `<script>` tag:
128+
127129
```html
128130
<html>
129131
<script src="https://cdn.jsdelivr.net/npm/@ruby/[email protected]/dist/browser.script.iife.js"></script>
@@ -136,7 +138,7 @@ end
136138
</html>
137139
```
138140

139-
Or using `@ruby/wasm-wasi` package API:
141+
Or using `@ruby/wasm-wasi` package API `RubyVM#evalAsync`:
140142

141143
```html
142144
<html>

0 commit comments

Comments
 (0)