Skip to content

Instantly share code, notes, and snippets.

@wesm87
Last active January 2, 2018 17:46
Show Gist options
  • Save wesm87/8710e1bb2c2c1a62c78d44ea5713d1ec to your computer and use it in GitHub Desktop.
Save wesm87/8710e1bb2c2c1a62c78d44ea5713d1ec to your computer and use it in GitHub Desktop.
Takes a value and returns a function that returns that value. Always returns a new reference if the value is an object or array.
import { is, when, anyPass, clone } from 'ramda'
const stubValue = (value) => () => when(
anyPass([
is(Array),
is(Object),
]),
clone,
)(value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment