Created
June 5, 2017 22:59
-
-
Save JBreit/a6424e3c34cac745d88e30e64af43fa3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/* global document Rx*/ | |
const link = document.querySelector('.nav-link'); | |
const link$ = Rx.Observable.fromEvent(link, 'click'); | |
const observer = { | |
next(event) { | |
console.log(event); | |
}, | |
error(err) { | |
console.error(err); | |
}, | |
complete() { | |
document.createElement('p').innerHTML = JSON.stringify(event.target.value); | |
} | |
}; | |
link$.subscribe(observer); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment