Skip to content

Instantly share code, notes, and snippets.

@vsavkin
Created May 24, 2013 15:55
Show Gist options
  • Save vsavkin/5644484 to your computer and use it in GitHub Desktop.
Save vsavkin/5644484 to your computer and use it in GitHub Desktop.
var inputs =
$("#query").
keyupAsObservable().
select(function(event){return event.target.value;}).
where(function(text){return text.length > 2;}).
throttle(500).
distinctUntilChanged();
inputs.
select(queryWikipedia).
switchLatest().
where(function(res){return res.data[1].length > 1;}).
select(function(res){return res.data[1];}).
subscribe(updateResults);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment