Documentation
¶
Rendered for js/wasm
Overview ¶
Package jspromise provides a simple JavaScript Promise implementation for Go WebAssembly.
Index ¶
- func All(promises []js.Value) ([]js.Value, error)
- func Await(promise js.Value) (js.Value, error)
- func Catch(promise js.Value, onRejected func(error)) js.Value
- func New() (js.Value, func(interface{}), func(interface{}))
- func Race(promises []js.Value) (js.Value, error)
- func Reject(reason interface{}) js.Value
- func Resolve(value interface{}) js.Value
- func Then(promise js.Value, onFulfilled func(js.Value)) js.Value
- type Promise
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New creates a new JavaScript Promise and returns the promise along with resolve and reject callbacks. The returned callbacks can be called from Go to resolve or reject the promise.
Types ¶
Click to show internal directories.
Click to hide internal directories.