viperHTML / viperhtml.github.io

Showcase of the ${hyper,viper,native}HTML family
ISC License
27 stars 11 forks source link

Add documentation for not primitive attributes #29

Closed jiayihu closed 6 years ago

jiayihu commented 6 years ago

Basically used the same code as posted in https://github.com/WebReflection/hyperHTML/issues/240#issuecomment-419079981, but without the stuff in the constructor. Honestly, I don't know the reason for using self.html and return self.

Is it something related to the content of this slide of yours? However the other examples don't follow this pattern, so I left it out of this PR. The goal is to keep it simple for newcomers like myself, so if it's some browser edge-case shit, I'd ignore it.

P.S. Fixed some grammar error on the way, thanks to Grammarly ❤️

jiayihu commented 6 years ago
screen shot 2018-09-06 at 18 12 51

I see also that, no matter how much programming experience you have, it's always fun working with CI 😄

jiayihu commented 6 years ago

Okay fixed the requested changes and replaced the constructor stuff with get html() { return this._html || (this._html = hyperHTML.bind(this)); }, although I would have preferred to keep this.html = hyperHTML.bind(this) for consistency.

Also it's this._html = hyperHTML.bind(this), and not this._html = hyperHTML(this), for the same consistency reason.

I believe it's better to have an intuitive documentation than performance-wise, but inconsistent, examples

jiayihu commented 6 years ago

Done!