Preview:
const { fromEvent } = rxjs;
const { switchMap, takeUntil, map } = rxjs.operators;

const card = document.querySelector('.card');

const mouseDown$ = fromEvent(card,'mousedown');
const mouseUp$ = fromEvent(document, 'mouseup');
const mouseMove$ = fromEvent(document, 'mousemove');
const dragAndDrop$ = mouseDown$.pipe(
  map(e => ({})),
  switchMap( start => mouseMove$.pipe(
    takeUntil(mouseUp$)
  ))
);
dragAndDrop$.subscribe(v => console.log(v))
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter