Skip to content

Allow passing multiple child nodes as arguments #8

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

Closed
wants to merge 3 commits into from

Conversation

brechtcs
Copy link
Contributor

@brechtcs brechtcs commented Sep 25, 2018

Other implementations—most notably hyperscript itself—allow passing multiple child nodes as arguments to the factory function, instead of just as a single array argument. This PR adds support for that usage to hastscript. Based on the existing tests, this shouldn't break any current behaviour, because they all passed without modification.

@brechtcs
Copy link
Contributor Author

I only ran node test.js before opening this PR, so I missed the code coverage issue. Should be good to go now.

@wooorm
Copy link
Member

wooorm commented Sep 25, 2018

Hmm, so I guess we already supported h(name, props, [[nodes...], [nodes...]]), so that’s why this works? 🤔

@brechtcs
Copy link
Contributor Author

Indeed, it's when I noticed nested arrays already worked that I figured supporting this multiple argument syntax wouldn't be too complicated.

@wooorm
Copy link
Member

wooorm commented Sep 25, 2018

OK! I’m up for this, but could you update the docs?

@brechtcs
Copy link
Contributor Author

Sure, will do 👌

@brechtcs
Copy link
Contributor Author

I pushed some documentation changes. Do let me know if you think there's something missing.

@wooorm wooorm closed this in 15fd90e Oct 4, 2018
@wooorm
Copy link
Member

wooorm commented Oct 4, 2018

Sorry I took a while, landed!

@wooorm wooorm added ⛵️ status/released 🗄 area/interface This affects the public interface 🦋 type/enhancement This is great to have 🧒 semver/minor This is backwards-compatible change labels Aug 11, 2019
@wooorm wooorm added the 💪 phase/solved Post is done label Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🗄 area/interface This affects the public interface 💪 phase/solved Post is done 🧒 semver/minor This is backwards-compatible change 🦋 type/enhancement This is great to have
Development

Successfully merging this pull request may close these issues.

2 participants