import { fromEvent, map, startWith } from 'rxjs'; import { RegisterElement } from '../custom-element'; RegisterElement('ambient-window', null, (e: Element, { onmousemove }) => { // const resize = fromEvent(window, 'resize'); const mousemove = fromEvent(window, 'mousemove'); // color.subscribe(c=>ctx.strokeStyle = c); // onmousemove && window.when('mousemove').subscribe(onmousemove) onmousemove && mousemove.subscribe(onmousemove); }); // export const Window = () => { // return { // innerSize: resize.pipe( // map(() => [window.innerWidth, window.innerHeight] as const), // startWith([window.innerWidth, window.innerHeight]), // ), // innerWidth: resize.pipe( // map(() => window.innerWidth), // startWith(window.innerWidth), // ), // innerHeight: resize.pipe( // map(() => window.innerHeight), // startWith(window.innerHeight), // ), // } // }