Skip to content

Commit

Permalink
docs: Clarify what makes await available
Browse files Browse the repository at this point in the history
  • Loading branch information
kateinoigakukun committed Dec 15, 2023
1 parent b0c4f7b commit f2db8cf
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/cheat_sheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ end

### `await` JavaScript `Promise` from Ruby

`data-eval="async"` attribute is required to use `await` in `<script>` tag:

```html
<html>
<script src="https://cdn.jsdelivr.net/npm/@ruby/[email protected]/dist/browser.script.iife.js"></script>
Expand All @@ -136,7 +138,7 @@ end
</html>
```

Or using `@ruby/wasm-wasi` package API:
Or using `@ruby/wasm-wasi` package API `RubyVM#evalAsync`:

```html
<html>
Expand Down

0 comments on commit f2db8cf

Please sign in to comment.