Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
RamdaJS trick, handle uncurried side-effect functions (e.g. console) in a chain while still currying the value back
//RamdaJS trick, handle uncurried side-effect functions (e.g. console) in a chain while still currying the value back
const sideFx = R.pipe(R.juxt([console.log, console.error, R.identity]), R.last);
// > R.pipe(R.add(1), sideFx, R.add(4))(1);
// >> console.log(2);
// >> console.error(2);
// >> 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.