API reference / @evolu/common / Result

Result

Interfaces

InterfaceDescription
ErrAn error Result.
OkA successful Result.

Type Aliases

Type AliasDescription
Result🛡️ Type-safe errors

Functions

FunctionDescription
errCreates an Err result.
getOrThrowExtracts the value from a Result if it is an Ok, or throws an error if it is an Err.
okCreates an Ok result.
tryAsyncWraps async functions or any operation returning a promise, returning a Result.
trySyncWraps synchronous functions that may throw exceptions, returning a Result.

Was this page helpful?