Skip to main content

Overview

Constructs an Ok variant of Result. This represents a successful computation with a value.

Signature

Parameters

T
required
The success value to wrap in an Ok result. Can be any type including null, undefined, or void.

Returns

Returns an Ok<T, E> instance containing the provided value.

Examples

Basic Usage

With Null or Undefined

Type Annotations