> Browsers have become so nice to work with, that these days, I get away with just the following two lines of code to simplify DOM manipulation:
>
> dqs = document.querySelector.bind(document);
> dqsA = document.querySelectorAll.bind(document);
Sounds useful and reasonable.
> I usually import the two functions from a module like this:
>
> import { dqs, dqsA } from '/lib/js/dqs.js';
Utterly absurd. Just copy and paste. It’s only two simple lines, how could it be worth a dependency?
Sounds useful and reasonable.
> I usually import the two functions from a module like this: > > import { dqs, dqsA } from '/lib/js/dqs.js';
Utterly absurd. Just copy and paste. It’s only two simple lines, how could it be worth a dependency?