Hacker News new | past | comments | ask | show | jobs | submit login

Wow! What a coincidence! I literally have something extremely similar which I called `$e`. I think one crucial thing you did not mention is that this conforms to the signature of jsxFactory, meaning if you run some kind of transpiler that supports jsx, you can literally do:

parent.append(<p>Hello</p>);

(Mine has slightly more functionalities, such as allowing passing in styles as a object, auto concatenate array of strings for class names, etc.)




Joining this thread to say that I, too, have written a very similar function and also use jsxFactory to have JSX support in personal projects. I find that using it along with an extremely simple implementation of a kind of state listener[0] produces something really nice for small projects.

It's a bit like a jquery for the '20s.

[0] https://github.com/curlywurlycraig/vdom-util/blob/master/src...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: