Skip to content

Instantly share code, notes, and snippets.

@wyeo
Created May 29, 2017 15:40
Show Gist options
  • Save wyeo/691d0b22b902a6b979c87cb2b85359f5 to your computer and use it in GitHub Desktop.
Save wyeo/691d0b22b902a6b979c87cb2b85359f5 to your computer and use it in GitHub Desktop.
const btn = document.getElementById('btn')
const values = [1, 2, 3, 4, 5]
function logger(event) {
console.log(`Logger : ${event}`)
btn.removeEventListener('click', logger)
}
// btn.addEventListener('click', logger)
// const btn$ = Rx.Observable.fromEvent(btn, 'click')
// values.forEach(logger)
// btn$.subscribe(logger)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment