Closed jiayihu closed 6 years ago
I see also that, no matter how much programming experience you have, it's always fun working with CI 😄
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
Done!
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
andreturn 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 ❤️