Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mergeIn #24

Closed
benmosher opened this issue Jun 1, 2016 · 2 comments
Closed

mergeIn #24

benmosher opened this issue Jun 1, 2016 · 2 comments

Comments

@benmosher
Copy link

Proposed as a shortcut, implemented as follows:

import { updateIn, merge } from 'icepick'

const mergeIn = (dest, path, source, associator) => 
  updateIn(dest, path, v => merge(v, source, associator))

Would be willing to implement. I'm not even sure if it's helpful, given how easy (and explicit) it is to construct on the fly. Just a thought.

@aearly
Copy link
Owner

aearly commented Jun 1, 2016

Hmnn, I feel this is easier to do manually, either through defining mergeIn yourself, or doing

var newObj = i.updateIn(obj, path, (val) => i.merge(val, source))

@benmosher
Copy link
Author

Makes sense. Just thinking out loud. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants