Skip to main content
Module

x/rambda/source/when.spec.js

Faster and smaller alternative to Ramda
Go to Latest
File
import {add} from './add'import {when} from './when'
const predicate = x => typeof x === 'number'
test('happy', () => { const fn = when(predicate, add(11)) expect(fn(11)).toBe(22) expect(fn('foo')).toBe('foo')})