3 ms·
window['$'] = selector => document.querySelector(selector) window['$$'] = selector => Array.from(document.querySelectorAll(selector)) is really what I want
by synergy20 2y ago
window['$'] = selector => document.querySelector(selector)
window['$$'] = selector => Array.from(document.querySelectorAll(selector))
is really what I want to have
- iudqnolq 2y agoI'm quite fond of a little helper like so: createElement({ className: 'p-2 flex justify-end', contents: createElement({ tag: 'img', src: '/os-logo-maps.svg' }), }); I got the idea from Lea Verou's blissfuljs. When you're creating a bunch of nested elements it comes in handy.
- meow_catrix 2y agoThat’s React without the JSX sugar.
- smusamashah 2y agoWhat's the point of the rest of the code? Looks useless.