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

Add DeepmergeInto #51

Closed
RebeccaStevens opened this issue Feb 15, 2022 Discussed in #49 · 4 comments · Fixed by #267
Closed

Add DeepmergeInto #51

RebeccaStevens opened this issue Feb 15, 2022 Discussed in #49 · 4 comments · Fixed by #267
Labels
Accepted This issue or PR has been accepted. Status: Released on Next It's now live on the next branch. Status: Released It's now live. Type: Feature New features or options.

Comments

@RebeccaStevens
Copy link
Owner

Discussed in #49

Originally posted by NightProgramming February 15, 2022
Sometimes it's useful to not create a new merge result object, but to have an existing object, that is the target of the whole merging process. Right now, I think, I would have to do something like:

// We want to merge newestData into myDataObject:

const result = deepmerge(myDataObject, newestData);
Object.assign(myDataObject, result);

If there was a signature like deepmerge(target, ...sources) the performance might be better because no intermediate object (result) needs to be created. Also there would be less code required (no Object.assign). And if we don't want to merge into any existing object we could do const result = deepmerge({}, myDataObject, newestData));. Note: The return value is the same object we used as first argument. Without having it returned by deepmerge we would need a bit more code: const result = {}; deepmerge(result, myDataObject, newestData);

@RebeccaStevens RebeccaStevens added Accepted This issue or PR has been accepted. Type: Feature New features or options. labels Feb 15, 2022
@bombillazo
Copy link

This feature would be great! Im needing it at the moment :)

@rendomnet
Copy link

Count me in!

RebeccaStevens added a commit that referenced this issue Feb 5, 2023
RebeccaStevens added a commit that referenced this issue Feb 5, 2023
RebeccaStevens added a commit that referenced this issue Feb 5, 2023
RebeccaStevens added a commit that referenced this issue Feb 5, 2023
RebeccaStevens added a commit that referenced this issue Feb 5, 2023
RebeccaStevens added a commit that referenced this issue Feb 5, 2023
RebeccaStevens added a commit that referenced this issue Feb 6, 2023
RebeccaStevens added a commit that referenced this issue Feb 6, 2023
RebeccaStevens added a commit that referenced this issue Feb 6, 2023
github-actions bot pushed a commit that referenced this issue Feb 6, 2023
# [4.3.0](v4.2.2...v4.3.0) (2023-02-06)

### Features

* create deepmergeInto function ([9c350a0](9c350a0)), closes [#51](#51)
@github-actions
Copy link

github-actions bot commented Feb 6, 2023

🎉 This issue has been resolved in version 4.3.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot added the Status: Released It's now live. label Feb 6, 2023
github-actions bot pushed a commit that referenced this issue Feb 6, 2023
# [5.0.0-next.2](v5.0.0-next.1...v5.0.0-next.2) (2023-02-06)

### Features

* create deepmergeInto function ([9c350a0](9c350a0)), closes [#51](#51)
@github-actions
Copy link

github-actions bot commented Feb 6, 2023

🎉 This issue has been resolved in version 5.0.0-next.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions github-actions bot added the Status: Released on Next It's now live on the next branch. label Feb 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted This issue or PR has been accepted. Status: Released on Next It's now live on the next branch. Status: Released It's now live. Type: Feature New features or options.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants