From 3f10532ec7cd72ecf88b59e1737c8d34aebb9d3b Mon Sep 17 00:00:00 2001 From: John Colvin Date: Sun, 2 Mar 2025 14:04:55 +0000 Subject: [PATCH 1/2] Fix Result.asyncMap vs ResultAsync.map doc links --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5777600a..48ee3afb 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ For asynchronous tasks, `neverthrow` offers a `ResultAsync` class which wraps a - [`Result.asyncAndThen` (method)](#resultasyncandthen-method) - [`Result.orElse` (method)](#resultorelse-method) - [`Result.match` (method)](#resultmatch-method) - - [`Result.asyncMap` (method)](#resultasyncmap-method) + - [`Result.asyncMap` (method)](#result-asyncmap-method) - [`Result.andTee` (method)](#resultandtee-method) - [`Result.orTee` (method)](#resultortee-method) - [`Result.andThrough` (method)](#resultandthrough-method) @@ -511,6 +511,7 @@ const answer = computationThatMightFail() --- + #### `Result.asyncMap` (method) Similar to `map` except for two things: From 5162be8c1188139c76b69d5be0daa7e631459dc4 Mon Sep 17 00:00:00 2001 From: John Colvin Date: Sun, 2 Mar 2025 14:08:00 +0000 Subject: [PATCH 2/2] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 48ee3afb..28725e82 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ For asynchronous tasks, `neverthrow` offers a `ResultAsync` class which wraps a - [`ResultAsync.fromThrowable` (static class method)](#resultasyncfromthrowable-static-class-method) - [`ResultAsync.fromPromise` (static class method)](#resultasyncfrompromise-static-class-method) - [`ResultAsync.fromSafePromise` (static class method)](#resultasyncfromsafepromise-static-class-method) - - [`ResultAsync.map` (method)](#resultasyncmap-method) + - [`ResultAsync.map` (method)](#resultasync-map-method) - [`ResultAsync.mapErr` (method)](#resultasyncmaperr-method) - [`ResultAsync.unwrapOr` (method)](#resultasyncunwrapor-method) - [`ResultAsync.andThen` (method)](#resultasyncandthen-method) @@ -1039,6 +1039,7 @@ export const signupHandler = route((req, sessionManager) => --- + #### `ResultAsync.map` (method) Maps a `ResultAsync` to `ResultAsync` by applying a function to a contained `Ok` value, leaving an `Err` value untouched.