You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
{
2
2
"private": false,
3
3
"name": "typescript-result",
4
-
"version": "3.3.0-beta.1",
4
+
"version": "3.3.0-beta.2",
5
5
"description": "A Result type inspired by Rust and Kotlin that leverages TypeScript's powerful type system to simplify error handling and make your code more readable and maintainable.",
Copy file name to clipboardExpand all lines: readme.md
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1455,6 +1455,7 @@ Executes the given `fn` (async) generator function and encapsulates the returned
1455
1455
This method is often used once as entry point to run a specific flow. The reason for this is that nested generator functions or calls to other functions that return results are supported.
1456
1456
1457
1457
#### Parameters
1458
+
-`self` optional `this` context to bind the generator function to.
1458
1459
-`fn` (async) generator function to execute.
1459
1460
1460
1461
**returns** a new [`AsyncResult`](#asyncresult) or `Result` instance depending on the provided callback fn.
Similar to [`Result.gen()`](#resultgen) this method transforms the given generator function into a `Result` or [`AsyncResult`](#asyncresult) depending on whether the generator function contains async operations or not.
Copy file name to clipboardExpand all lines: src/result.ts
+65-11Lines changed: 65 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -1987,6 +1987,7 @@ export class Result<Value, Err> {
1987
1987
* Executes the given {@linkcode fn} (async) generator function and encapsulates the returned value or error as a Result.
1988
1988
* This method is often used once as entry point to run a specific flow. The reason for this is that nested generator functions or calls to other functions that return results are supported.
1989
1989
*
1990
+
* @param self optional `this` context to bind the generator function to.
1990
1991
* @param fn generator function with code to execute. Can be synchronous or asynchronous.
1991
1992
* @returns a new {@linkcode Result} or {@linkcode AsyncResult} instance depending on the provided callback fn.
1992
1993
*
@@ -2001,14 +2002,43 @@ export class Result<Value, Err> {
0 commit comments