API reference / @evolu/common / Result
Result
Interfaces
Interface | Description |
---|---|
Err | An error Result. |
Ok | A successful Result. |
Type Aliases
Type Alias | Description |
---|---|
Result | 🛡️ Type-safe errors |
Functions
Function | Description |
---|---|
err | Creates an Err result. |
getOrThrow | Extracts the value from a Result if it is an Ok , or throws an error if it is an Err . |
ok | Creates an Ok result. |
tryAsync | Wraps async functions or any operation returning a promise, returning a Result. |
trySync | Wraps synchronous functions that may throw exceptions, returning a Result. |