snabbdom / snabbdom-to-html

Render Snabbdom Vnode’s to HTML strings
94 stars 21 forks source link

Simplify API #2

Closed acstll closed 8 years ago

acstll commented 8 years ago

The main export becomes an toHTML function, ready to use. init is available at snabbdom-to-html/init if you need it.

Check this branch out where it's implemented: https://github.com/acstll/snabbdom-to-html/tree/toHTML

What do you think?

@TylorS

TylorS commented 8 years ago

I think it would be much easier to import. I always like to provide sane defaults like this. I'm definitely in favor of this change! :+1:

In general though, it might be better to ask if are there any drawbacks to this approach? If so, can they be avoided?

acstll commented 8 years ago

I don't see any drawbacks, since both ways of importing, normal and shortcut, will be available.

If you're using snabbdom already, then the current way should be familiar and no problem, but it's also true that if you don't want to get fancy the two built-in modules is all you're gonna need, so it's nice to offer the shortcut.

I'll merge and bump a major then!

TylorS commented 8 years ago

:+1: