promise

package
v1.0.0-rc2 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotImplemented     = errors.New("Browser not implemented Promise")
	ErrNotAPromise        = errors.New("Object is not a Promise")
	ErrResultPromiseError = errors.New("Result error promise")
)

Functions

func GetInterface

func GetInterface() js.Value

GetInterface get teh JS interface of broadcast channel

Types

type Promise

type Promise struct {
	baseobject.BaseObject
}

Promise struct

func All

func All(values ...interface{}) (Promise, error)

func AllSettled

func AllSettled(values ...interface{}) (Promise, error)

func Any

func Any(values ...interface{}) (Promise, error)

func New

func New(handler func() (interface{}, error)) (Promise, error)

func NewFromJSObject

func NewFromJSObject(obj js.Value) (Promise, error)

func Race

func Race(values ...interface{}) (Promise, error)

func SetTimeout

func SetTimeout(handler func() (interface{}, error), ms int) (Promise, error)

func (Promise) Async

func (p Promise) Async(resolve func(baseobject.BaseObject) *Promise, reject func(error)) error

will be deprecated

func (Promise) Await

func (p Promise) Await() (interface{}, error)

func (Promise) Catch

func (p Promise) Catch(reject func(error)) error

func (Promise) Finally

func (p Promise) Finally(f func()) error

func (Promise) Promise

func (p Promise) Promise() Promise

func (Promise) Then

func (p Promise) Then(resolve func(interface{}) *Promise, reject func(error)) error

type PromiseFrom

type PromiseFrom interface {
	Promise() Promise
}

Jump to

Keyboard shortcuts

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