Skip to content

Instantly share code, notes, and snippets.

@DimitryDushkin
Created July 20, 2019 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DimitryDushkin/bc195c8fda188ca63a967d7445fd73a2 to your computer and use it in GitHub Desktop.
Save DimitryDushkin/bc195c8fda188ca63a967d7445fd73a2 to your computer and use it in GitHub Desktop.
return down$.pipe(
mergeMap(e => {
startPosition = startPosition || { x: e.pageX, y: e.pageY };
return move$.pipe(
takeUntil(up$),
map(e => ({
x: e.pageX - startPosition.x,
y: e.pageY - startPosition.y
}))
);
})
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment