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

Support merge generators #29

Open
2 tasks done
SettingDust opened this issue May 11, 2023 · 1 comment
Open
2 tasks done

Support merge generators #29

SettingDust opened this issue May 11, 2023 · 1 comment

Comments

@SettingDust
Copy link

SettingDust commented May 11, 2023

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the feature has not already been requested

🚀 Feature Proposal

Support merge generators

Motivation

No response

Example

const values1 = function * () {
  yield * [0, 1, 2, 3, 4]
}
const values2 = function * () {
  yield * [5, 6, 7, 8, 9]
}

deepmerge(values1, value2) // generator like 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 <- ordered
const values1 = async function * () {
  yield * [0, 1, 2, 3, 4]
}
const values2 = async function * () {
  yield * [5, 6, 7, 8, 9]
}

deepmerge(values1, value2) // async generator like 0, 1, 5, 2, 6, 7, 3, 4, 8, 9 <- no order
@mcollina
Copy link
Member

I think this should be a separate function than the main deepmerge.

Overall, I think this might be better implemented as a new utility module.

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

No branches or pull requests

2 participants