Skip to content

Instantly share code, notes, and snippets.

@MeetMartin
Last active February 4, 2022 00:07
Show Gist options
  • Save MeetMartin/6584ec1a10d3be10b9aa19d4c723ceea to your computer and use it in GitHub Desktop.
Save MeetMartin/6584ec1a10d3be10b9aa19d4c723ceea to your computer and use it in GitHub Desktop.
// composition snippet from https://github.com/MeetMartin/did-authentication/blob/main/effects/Authentication.js
const DIDAuthentication = challengeId =>
compose(
map(passThrough(url => logger.debug(`DID Authentication Redirect URL: ${deepInspect(url)}`))),
flatMap(authentication),
flatMap(saveChallenge),
eitherToAsyncEffect,
map(passThrough(input => logger.debug(`DID Authentication Input Variables: ${deepInspect(input)}`))),
getInputVariables,
)(challengeId);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment