These are chat archives for ramda/ramda

8th
Jun 2018
Lewis
@6ewis
Jun 08 2018 19:23
  R.or(R.isNil(foo), hasItem(foo) === 'No')
i wanna check when foo is undefined, null or no then return true
whats wrong with my logic
@Bradcomp
Brad Compton (he/him)
@Bradcomp
Jun 08 2018 19:27
Is that not working?
either(isNil, equals('No'))(foo)
Like that?
Lewis
@6ewis
Jun 08 2018 19:32
nope
it's not working as expected...im investigaitng if foo is what i think it is though
@Bradcomp is there a difference between that and either
Brad Compton (he/him)
@Bradcomp
Jun 08 2018 19:33
either takes 2 functions and returns another function, whereas or takes two values and returns a || b
Lewis
@6ewis
Jun 08 2018 19:35
nope i need true or false being returned so either wont do
@Bradcomp thanks
so if the logic is correct..foo is not what i expect
Brad Compton (he/him)
@Bradcomp
Jun 08 2018 19:36
well, I don't know what hasItem does...
Lewis
@6ewis
Jun 08 2018 19:39
it returns a string
@Bradcomp
Brad Compton (he/him)
@Bradcomp
Jun 08 2018 19:41
So then this: hasItem(foo) === 'No' is always going to be false regardless of the value of foo
Lewis
@6ewis
Jun 08 2018 19:41
sorry
@Bradcomp so 'no', 'yes' or null or undefined, this is what it returns. my fault
Lewis
@6ewis
Jun 08 2018 19:55
thanks btw
Brad Compton (he/him)
@Bradcomp
Jun 08 2018 20:00
:bowtie:
Lewis
@6ewis
Jun 08 2018 20:03
@Bradcomp you should write a book on Ramda, ..now you're an expert