[fabric/core] Overload AsyncResult.ok method to support optional value parameter

This commit is contained in:
Pablo Baleztena 2024-10-30 22:38:28 -03:00
parent 623e67afeb
commit b77ba6dc83

View File

@ -35,7 +35,9 @@ export class AsyncResult<
); );
} }
static ok<T>(value: T): AsyncResult<T, never> { static ok(): AsyncResult<void, never>;
static ok<T>(value: T): AsyncResult<T, never>;
static ok(value?: any) {
return new AsyncResult(Promise.resolve(Result.ok(value))); return new AsyncResult(Promise.resolve(Result.ok(value)));
} }