Fast h function
See original GitHub issueHello there!
Do you have a recommendation for a fast h function? (framework-agnostic) I found a tweet from developit for a short one.
function h(el, props, ...kids) {
el = document.createElement(el)
for (let i in props) i in el
? el[i] = props[i]
: el.setAttribute(i,props[i])
el.append(...kids)
return el
}
But after running some tests, I think this could be more performant. Sadly I do not have the knowledge where to look at. Thank you for the help! Pete
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
H Function (Fox's H-Function) - Statistics How To
The H function (sometimes called Fox's H function) is a very generally defined special function, due to Charles Fox (1928). It can be...
Read more >Effect of 48 h Fasting on Autonomic Function, Brain ... - PubMed
48 h fasting resulted in higher parasympathetic activity and decreased resting frontal brain activity, increased anger, and improved prefrontal-cortex-related ...
Read more >A fast algorithm to compute the H∞-norm of a transfer function ...
A fast algorithm is presented to compute the H ∞ - norm of a transfer function matrix, based on the relation between the...
Read more >Fast maths functions - The Bela Knowledge Base
Function Range Number ABS Max Err REL Max Err(%) RMS Err Time Rate
sinf ‑3.14, 3.14 500000 0.00000000 0.00000000 0.00000000 262041 1.00
sinf_neon ‑3.14, 3.14...
Read more >8 Health Benefits of Fasting, Backed by Science - Healthline
Fasting has been shown to have many health benefits, from increased weight loss to better brain function. Here are 8 health benefits of ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@PeteSolid I got an issue with this :
I first expected the
<li>
h() function to receive a children list with 6 items, but It will receive 2 children, one with the first inline<span>
and one array with the 5 dynamic<span>{item}</span>
.I did a small code sandbox to show the problem : https://codesandbox.io/s/busy-sun-f4db5
@developit Is it an expacted behaviour ?
This function doesn’t handle kids that contains array close to textNode (or other Node). It won’t handle event listener too. Here is my current approach. I don’t know if it’s fast but it covers all the edge case I encountered at the moment (maybe it helps)