Skip to content

Instantly share code, notes, and snippets.

@taroyanaka
Forked from sebabouche/ramda3.js
Created October 24, 2018 02:38
Show Gist options
  • Save taroyanaka/57d7d584c310952d4d0bd243c93463f0 to your computer and use it in GitHub Desktop.
Save taroyanaka/57d7d584c310952d4d0bd243c93463f0 to your computer and use it in GitHub Desktop.
ramda: cond, always, T, identity
import { cond, always, lte, gte, T, __, identity } from "ramda"
const water = cond([
[lte(__, 0), temp => `water freezes at ${temp}°C`],
[gte(__, 100), temp => `water boils at ${temp}°C`],
[T, temp => `nothing special happens at ${temp}°C`],
])
console.log(water(-222))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment