Skip to content

Instantly share code, notes, and snippets.

@WouterSpaak
Last active November 9, 2018 13:07
Show Gist options
  • Save WouterSpaak/9c4121f1fb9c5c914c8d78c9c7d24fbd to your computer and use it in GitHub Desktop.
Save WouterSpaak/9c4121f1fb9c5c914c8d78c9c7d24fbd to your computer and use it in GitHub Desktop.
@ObservableHostListener<MouseEvent, Coordinate>(
'window:click',
['$event'],
pipe(
map(({ clientX, clientY }) => {
return { x: clientX, y: clientY };
})
)
)
coordinateStream$: Observable<Coordinate>;
interface Coordinate {
x: number;
y: number;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment