Skip to content

Instantly share code, notes, and snippets.

@Fristi
Created April 14, 2012 13:37
Show Gist options
  • Save Fristi/2384518 to your computer and use it in GitHub Desktop.
Save Fristi/2384518 to your computer and use it in GitHub Desktop.
Autocomplete jQuery + RxJS + CoffeeScript
@searchBox.keyupAsObservable()
.select((ev) -> $(ev.target).val())
.where((text) -> text.length > 2)
.throttle(500)
.distinctUntilChanged()
.select(@searchItems)
.switchLatest()
.subscribe(@handleItemSearchAutoCompleteSuccess)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment