Skip to content

Instantly share code, notes, and snippets.

@shrynx
Created October 25, 2016 05:12
Show Gist options
  • Save shrynx/ed77ab9c4ea6ff2ef759f042e68b5333 to your computer and use it in GitHub Desktop.
Save shrynx/ed77ab9c4ea6ff2ef759f042e68b5333 to your computer and use it in GitHub Desktop.
// Select the button we need need to listen upon.
const myButton = document.querySelector('#click-me')
// Create a stream of clicks, using fromEvent function,
// by passing the button and the event listener.
const click$ = Rx.Observable.fromEvent(myButton, 'click')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment