API reference › @evolu/common › Result › ok
Call Signature
function ok(): Result<void>;
Defined in: packages/common/src/Result.ts:303
Creates an Ok result.
ok()creates aResult<void, never>for operations that succeed without producing a value.ok(value)creates aResult<T, never>containing the specified value.
Example
const noValue = ok();
console.log(noValue); // { ok: true, value: undefined }
const success = ok(42);
console.log(success); // { ok: true, value: 42 }
Call Signature
function ok<T>(value: T): Result<T>;
Defined in: packages/common/src/Result.ts:305
Creates an Ok result with a specified value.