import { Observable , animationFrameScheduler , auditTime , fromEvent , map , merge , startWith } from "rxjs" ; import { ElementOffset } from "../_" ; param el returns export function getElementContentOffset ( el ) { return { x : el . scrollLeft , y : el . scrollTop } ; } param el returns export function watchElementContentOffset ( el ) { return merge ( fromEvent ( el , "scroll" ) , fromEvent ( window , "resize" ) ) . pipe ( auditTime ( 0 , animationFrameScheduler ) , map ( ( ) => getElementContentOffset ( el ) ) , startWith ( getElementContentOffset ( el ) ) ) ; }