package
2.16.0
Repository: https://github.com/tawesoft/golib.git
Documentation: pkg.go.dev

# Functions

Chain returns a new promise to compute function f on the result of promise p.
FromError creates a promise that simply returns the provided error when computed.
FromFunc creates a promise to call function f, where f returns any single value and has no facility to indicate an error.
FromFuncCtx creates a promise to call function f, where f accepts a context and returns any single value and has no facility to indicate an error, other than a context error.
FromOkFunc creates a promise to call function f, where f returns a (value, ok) tuple.
FromOkFuncCtx creates a promise to call function f, where f accepts a context and returns a (value, ok) tuple.
FromResultFunc creates a promise to call function f, where f returns a (result, error) tuple.
FromResultFuncCtx creates a promise to call function f, where f accepts a context and returns a (result, error) tuple.
FromValue creates a promise that simply returns the provided argument and a nil error when computed.
FromValueErr creates a promise that simply returns the provided argument or, if the provided error was non-nil, the provided error when computed.
WrapResultFunc wraps an existing function "f() => (X, error)" so that it becomes "f() => P[X]", a function that returns a promise.
WrapResultFunc1 wraps an existing function "f(A) => (X, error)" so that it becomes "f(A) => P[X]", a function that returns a promise.
WrapResultFunc2 wraps an existing function "f(A, B) => (X, error)" so that it becomes "f(A, B) => P[X]", a function that returns a promise.
WrapResultFunc3 wraps an existing function "f(A, B, C) => (X, error)" so that it becomes "f(A, B, C) => P[X]", a function that returns a promise.
WrapResultFunc4 wraps an existing function "f(A, B, C, D) => (X, error)" so that it becomes "f(A, B, C, D) => P[X]", a function that returns a promise.

# Variables

No description provided by the author

# Interfaces

P represents a promise to calculate and return some value when Compute or ComputeCtx is called.