Set prop and path#451
Conversation
ramda.js
Outdated
There was a problem hiding this comment.
setProp is in impure extension, so someone needs a new name
There was a problem hiding this comment.
We could name this function R.assoc after clojure.core/assoc. This function associates a key–value pair with a map.
|
I'd prefer a path to be of type |
ramda.js
Outdated
There was a problem hiding this comment.
This still will call spit each time, see R.where for how to add a hook for the first item
There was a problem hiding this comment.
Good catch. Will need to fix this.
|
@davidchambers While But perhaps we could have both in a reasonable way, using a different name than |
ramda.js
Outdated
There was a problem hiding this comment.
overriding the specified property with the given value
This phrase, along with the function's name, imply the function is to be used for setting the value of an existing property. The property needn't exist, though. In fact, "adding" to a map might be the more common operation.
There was a problem hiding this comment.
Oh, damn. Not thinking straight.
I'll have to update for that.
To go along with Lenses, I'd like to revisit the idea of pure setters.
Ping #398