These are chat archives for ramda/ramda

Jul 2018
Colin Kahn
Jul 11 2018 19:18
What is a good pattern for adding conditionals within a pipe based on something other than the piped value?
Mike Lambert
Jul 11 2018 19:19
a ternary expression?
Colin Kahn
Jul 11 2018 19:21
Is that the best option? Put a ternary choosing between what functions to pipe into?
Rocky Madden
Jul 11 2018 19:51
I was going to say the alternation combinator but that would work with the value. Is this something that could be in a thunk using something in scope?
Might need to see an example.
Ben Briggs
Jul 11 2018 21:52
@colinkahn Don't know what you're trying to do exactly but you can use always to swap in some other variable
    compose(equals(50), always(someOtherVar)),
    always('satisfied condition')
Most of the time when I'm doing something like this I'll use converge and let one of the branching functions reference some other variable, then join them all back up again with the converging function