These are chat archives for ramda/ramda

22nd
Oct 2017
Andrzej Lichnerowicz
@unjello
Oct 22 2017 01:18
@Bradcomp ah, I was sort of afraid, that's the only way. But that, breaks my nice little compose function into two sections. and I need composedAsync().then(composedSync), right? And if I happen to go async, sync, async, sync then it only gets worse :smile: I hoped there would be a way to unwrap it within single function
(single compose pipeline if you will)
Andrzej Lichnerowicz
@unjello
Oct 22 2017 01:23
or even it could work with tranducers
Cause for Promise.all I need to actually wait for all of the promises. I hoped in single compose pipeline, it could resolve them in tranducer fasion
Brad Compton (he/him)
@Bradcomp
Oct 22 2017 21:10
@unjello You could use something like this:
const then = (f) => (p) => p.then(f);

pipe(
  map(promiseReturningFunction),
 map(then(nextFn)),
//...
//at the end
Promise.all.bind(Promise) //turn it inside out
)