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

util for generating nested vnodes #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fuzetsu
Copy link
Owner

@fuzetsu fuzetsu commented Aug 24, 2019

  • exposed through n property of m instance

An idea... I like it and use it in a few projects, especially when I'm using a css library like bootstrap or bulma, since they use so many nested html elements with just classes.

Would grow library size by ~54b.

Usage looks like this:

const m = microh(preact.h)
const vnodes = m.n('li.list-item > a.menu-link', { href: '#' })
// vnodes === m('li.list-item', m('a.menu-link', { href: '#' }))

@fuzetsu fuzetsu force-pushed the nested-children-selector-util branch from 2c30ef2 to 82e498c Compare August 24, 2019 00:47
- exposed through `n` property of m instance
@fuzetsu fuzetsu force-pushed the nested-children-selector-util branch from 82e498c to 56c8f32 Compare September 6, 2019 03:05
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

Successfully merging this pull request may close these issues.

1 participant