Created
November 27, 2020 14:14
-
-
Save the-frey/668335eee9910c6e4a6b8d396e033945 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const pipeline = pipe( | |
| TE.fromEither(getIdFromPath(event)), // start a pipe of TaskEither | |
| TE.chain(uid => getUser(client, uid)), | |
| TE.chainEitherK(getUserFromRes), // chainEitherK: <E, A, B>(f: (a: A) => E.Either<E, B>) => (ma: TaskEither<E, A>) => TaskEither<E, B> | |
| TE.chainEitherK(userToSharable), | |
| TE.map(userWithoutPII => responses.respond200('<your-project>/user', userWithoutPII))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment