I'm trying to use cond() instead of switch, here is how I set it
const {forEachObjIndexed, equals, cond} = R;
const query = {
hardSkills : ['119928392'],
softSkills : null,
country: null,
status: null,
freeQuery: null
}
forEachObjIndexed((value, key) => {
if(value) {
console.log('before cond', key)
cond([
[equals('hardSkills', key), console.log('in hardSkills')],
[equals('softSkills', key), console.log('in softSkills')]
])
}
}, query)
<script src="https://cdnjs.cloudflare.com/ajax/libs/ramda/0.27.1/ramda.min.js"></script>
output
before cond hardSkills
in hardSkills
in softSkills
According to my understanding, 'in softSkills' shouldn't be displayed, because the second equals statement return false. But Ramda does not look ok with that.
Any idea ?
Thanks in advance to everyone