rimmel
Version:
A Streams-Oriented UI library for the Rx.Observable Universe
18 lines (15 loc) • 705 B
JavaScript
import { map } from 'rxjs';
import { pipeIn } from '../utils/input-pipe.js';
/**
* An Event Source emitting the "[event.clientX, event.clientY]" mouse coordinates
* @param querySelector A query selector to select nodes from the underlying element's subtree
* @param target A handler function or observer to send events to
*/
const All = (querySelector, target) => pipeIn(target, map((e) => [].concat(querySelector)
.flatMap(querySelector => [...e.currentTarget.querySelectorAll(querySelector)])));
const qsa = (qs) => map((e) => {
const t = e.currentTarget;
return [].concat(qs).flatMap(qs => [...t.querySelectorAll(qs)]);
});
export { All, qsa };
//# sourceMappingURL=all-source.js.map