Documentation ¶
Index ¶
- type Promise
- func All[T any](promises []*Promise[T]) *Promise[[]T]
- func Any[T any](promises []*Promise[T]) *Promise[T]
- func Catch[T any](promise *Promise[T], rejection func(err error) error) *Promise[T]
- func New[T any](runnable func(resolve func(T), reject func(error))) *Promise[T]
- func Race[T any](promises []*Promise[T]) *Promise[T]
- func Reject[T any](err error) *Promise[T]
- func Resolve[T any](resolution T) *Promise[T]
- func Then[T1, T2 any](promise *Promise[T1], resolve1 func(value T1) T2) *Promise[T2]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Promise ¶
type Promise[T any] struct { // contains filtered or unexported fields }
func All ¶
All resolves when all of the promises have resolved, reject immediately upon any of the input promises rejecting.
func Any ¶
Any resolves as soon as any of the input's Promises resolve, with the value of the resolved Promise. Any rejects if all of the given Promises are rejected with a combination of all errors.
Click to show internal directories.
Click to hide internal directories.