use fetch even if you need to support IE11, it's worth the polyfill IMO
fetch(someUrl).then(resp => resp.json()).then(data => doSomethingWith(data))
the end.
Please don't hack my scroll. I disabled all the javascript on your site to be able to read an article on (more or less) javascript.
Also, you didn't follow "Betteridge's law of headlines". Shame on you :p
Great article tho :)
Great tools! Thanks for sharing! I like this pipe utility better though: https://github.com/egeozcan/ppipe
const weirdMathPipe = x => ppipe(x)
.pipe(add, 1)
.pipe(double)
.pipe(square)
.pipe(divide, _, 8)
.pipe(add, 1);
it also works with sync functions and has placeholders, property extraction, and so many other features and still less than 150 lines (with 100% test coverage). p-pipe is 1/10 of that but well, I can't live without placeholders.
Great idea! 2 suggestions:
1) implement it as a tag for template literals so you can do fromHtml`#something`
2) create a webpack plugin so the templates can be precompiled