These are chat archives for ramda/ramda

23rd
Jan 2019
Just RAG
@justrag
Jan 23 10:42
@ben-eb OK, definitely need to check this lenses thing...
SamD
@SamD
Jan 23 20:20
Anyone here experience a case where R.when evaluates to to false but the trueFn is being invoked ?
I'm seeing that and stepping through in the debugger shows it happening, unless there is some type of evaluation of the trueFn that happens all the time
Brad Compton (he/him)
@Bradcomp
Jan 23 20:24
Can you post a minimal reproduction? The source code is pretty straightforward, I don't think that should be happening?
SamD
@SamD
Jan 23 20:32
alright going to try a few things first in the repl tool
SamD
@SamD
Jan 23 20:41
@Bradcomp nevermind, I was using hasPath as the test condition, I moved it outside and used it within an if instead of using R.when and it works as expected, for whatever reason the debugger was showing the break inside the trueFn. It is something like this
    const doSomething =  R.when(
        R.hasPath(refPath),
        R.pipe(
            mergeVmsEdgeRefSectionWithDataSection,
            mapAccumIndexed(mapper, {}),
            R.head,
            R.dissocPath(refPath),
        )
    );
Brad Compton (he/him)
@Bradcomp
Jan 23 20:42
I'm glad you got it sorted!