promise

package
v0.0.1-beta.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Rendered for js/wasm

Overview

Package promise waits for JavaScript Promises in Go code that uses syscall/js, in goesm's output and in Go's own js/wasm port.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Await

func Await(p js.Value) (js.Value, error)

Await waits until the Promise p settles and returns its value, or its rejection reason as a js.Error, so that errors.As reaches the reason (a DOMException named "AbortError", say). A value that is not a Promise is returned as it is, as JavaScript's await does.

goesm imports the function below from await.ts, as a function that blocks until the Promise settles (its body is for Go's js/wasm port).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL