Last active
September 27, 2017 01:22
-
-
Save joedski/feb637c49dad84b4c9e16807332840b0 to your computer and use it in GitHub Desktop.
comp-undo-steps 3: Instead of using an identity function to cap things off, use an unboxing/result-extracting function.
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
function handleSomeThing(ctx) { | |
return compose( | |
stepA(optionsA), | |
stepB(optionsB), | |
stepC(optionsC), | |
)(pctx => pctx.resultFoo)({ ctx }); | |
} | |
// Or somewhat more mysterious looking... | |
const handleSomeThing = compose( | |
// the Process Context boxing-up function. | |
next => ctx => next({ ctx }), | |
stepA(optionsA), | |
stepB(optionsB), | |
stepC(optionsC), | |
)(pctx => pctx.resultFoo); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment