Skip to content

Quick one: nicer way to do this? #3358

Closed Answered by kedashoe
pipedreambomb asked this question in Q&A
Discussion options

You must be logged in to vote

you could just update the first part

color = cond([
      ...
      [c => c.value in colorMap, c => colorMap[c.value]],
      ...
    ])

or more ramda-y

color = cond([
      ...
      [pipe(prop('value'), has(__, colorMap)), pipe(prop('value'), prop(__, colorMap))],
      ...
    ])

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by pipedreambomb
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants