then

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Rendered for js/wasm

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSFunc

type JSFunc struct {
	Value js.Value
}

func (JSFunc) SafeInvoke

func (jsf JSFunc) SafeInvoke(args ...interface{}) js.Value

SafeInvoke is like Invoke but handles errors in the args (which js.ValueOf chokes on). Feel encouraged to add other types that js.ValueOf doesn't handle and that you'd like to handle more gracefully than panicking.

type Then

type Then struct {
	// contains filtered or unexported fields
}

Then implements the javascript `Thenable` interface https://javascript.info/async-await so that Go can return something to js and js can `await` it

func New

func New() *Then

func (*Then) JSValue

func (t *Then) JSValue() js.Value

func (*Then) Reject

func (t *Then) Reject(err interface{})

func (*Then) Resolve

func (t *Then) Resolve(res interface{})

Jump to

Keyboard shortcuts

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