Categorygithub.com/nlepage/go-js-promise
modulepackage
1.1.0
Repository: https://github.com/nlepage/go-js-promise.git
Documentation: pkg.go.dev

# README

go-js-promise

Go WebAssembly utility package for interacting with JavaScript promises, and aiming to have an "idiomatic Go" API.

Documentation on pkg.go.dev.

Show your support

Give a ā­ļø and/or sponsor if this project helped you!

Author

šŸ‘¤ Nicolas Lepage

šŸ¤ Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

šŸ“ License

Copyright Ā© 2021 Nicolas Lepage.
This project is Apache 2.0 licensed.

# Functions

All waits for a given list of promises to be resolved and returns a list of the results.
AllSettled waits for a given list of promises to be fulfilled or rejected.
Any returns the result of the first fulfilled promise in a given list of promises.
Await waits for the given Promise to be resolved or rejected.
New creates a JavaScript Promise.
Race returns the result of the first fulfilled or rejected promise in a given list of promises.
Reject creates a JavaScript Promise rejected with a given value.
Resolve creates a JavaScript Promise resolved with a given value.

# Constants

Fulfilled is the state value of a resolved promise.
Rejected is the state value of a rejected promise.

# Type aliases

AggregateError is a JavaScript object representing an error when several errors need to be wrapped in a single error.
Reason is a JavaScript value a promise was rejected with.
Result is a JavaScript object that describes the outcome of a promise.