Last active
January 2, 2018 17:46
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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