Last active
April 26, 2017 04:55
-
-
Save Ibro/4545747ad99a4d45f343ee9ecc36e515 to your computer and use it in GitHub Desktop.
Subscribing to mouse events - Coding Blast - www.codingblast.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Observable } from 'rxjs'; | |
let source = Observable.fromEvent(document, 'mousemove'); | |
source.subscribe(next, error, complete); | |
function next(value: any) { | |
console.log('next: ', value); | |
} | |
function error(err: any) { | |
console.log('error: ', err); | |
} | |
function complete() { | |
console.log('complete'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment