Signature
tsSignature
export function from<T, E>(result: ResultLike<T, E>): Result<T, E>;Imports
tsImport
import { from } from "@/lib/flow/core/result";import { from } from "@/lib/flow";Type Parameters
TSuccess value type.
EExpected error value type.
Parameters
resultResultLike<T, E>
Structural success or failure object.
Returns
A branded Flow `Result`.
Return type
Result<T, E>Details
This is useful when adapting results from another library or from plain object literals.
Related Symbols
Result
Explicit success-or-failure outcome used throughout Flow.
type
ResultLike
Structural result shape accepted by `from`.
type
when
Branches between two behaviors using a predicate function.
function
Source
tsflow/core/result.ts:106-108
export function from<T, E>(result: ResultLike<T, E>): Result<T, E> { return result.ok ? ok(result.value) : err(result.error);}