rimmel
Version:
A Stream-Oriented UI library for the Rx.Observable Universe
20 lines (17 loc) • 574 B
JavaScript
import { map } from 'rxjs';
import { inputPipe } from '../utils/input-pipe.js';
/**
* An Event Operator emitting the "[x, y]" coordinates of the last touch event
* @returns OperatorFunction<TouchEvent, Coords>
*/
const lastTouchXY = map((e) => {
const t = [...e.touches].at(-1);
return [t?.clientX, t?.clientY];
});
/**
* An Event Source emitting the "[x, y]" coordinates of the last touch event
* @returns EventSource<Coords>
*/
const LastTouchXY = inputPipe(lastTouchXY);
export { LastTouchXY, lastTouchXY };
//# sourceMappingURL=last-touch-xy-source.js.map