x/rambda/source/when.spec.js
1234567891011import {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')})