These are chat archives for ramda/ramda

12th
Feb 2018
Luky
@lukywong_twitter
Feb 12 2018 08:06
i cannot open ramdajs.com REPL, is there anything i missed here?
Jason Shin
@JasonShin
Feb 12 2018 11:23
hey guys
if you have two functions that return futures and you have two different parameters to pass in. Desired end result is [resultOfFuture1, resultOfFuture2]
I'm using fluture + ramda
how would you achieve it?
example code
const func1 = test1 => Future(...)
const func2 = test2 => Future(...)

R.someMethod(Future.of, [func1, func2], [1, 2]).fork(...)
// func1 should receive 1, func2 should receive 2
// results should be [result of func1, result of func2]
James Forbes
@JAForbes
Feb 12 2018 12:57
R.sequence
James Forbes
@JAForbes
Feb 12 2018 12:57
oh wait they are funcs
So sequence(Future.of, [func1(1), func2(2)])
Syaiful Bahri
@syaiful6
Feb 12 2018 13:06
@JasonShin maybe it will combination of zipWith and sequence.
sequence(pure, zipWith(applyTo, args, fns))something like that i guess..
Mike Lambert
@lax4mike
Feb 12 2018 14:40
you could also use a folktale Task, which has a waitAll function
Denis Stoyanov
@xgrommx
Feb 12 2018 14:57
liftN(2, unapply(xs => Promise.resolve(xs)))(compose(add(10), head), compose(add(20), last))([1, 2]).then(x => console.log(x))
hiredgunhouse
@hiredgunhouse
Feb 12 2018 15:02
is there a way to make it even longer?
;)
sorry, no offence but that looks like an anti-advertisement for FP :/
Bijoy Thomas
@bijoythomas
Feb 12 2018 15:21
@xgrommx will that handle any Promise rejections? I believe the sequence will, right? If any one of the promises is rejected, then it should get rejected all together
CaribAlgorithm
@CaribAlgorithm
Feb 12 2018 18:50
Currently new to ramda and just wondering if anyone could share some useful tips for a new comer or resources.
CaribAlgorithm
@CaribAlgorithm
Feb 12 2018 19:10
@bijoythomas thanks finished reading all of it, but kinda looking for something to help me think more functional .
CaribAlgorithm
@CaribAlgorithm
Feb 12 2018 19:19
thank you
Bijoy Thomas
@bijoythomas
Feb 12 2018 19:20
yw
Mike Lambert
@lax4mike
Feb 12 2018 21:51
+1 on professor frisby
Jason Shin
@JasonShin
Feb 12 2018 22:05
thanks guys