Skip to content

Instantly share code, notes, and snippets.

@dineshprabu-freshdesk
Created November 13, 2017 05:27
Show Gist options
  • Save dineshprabu-freshdesk/cb97a85087f4e4d47b578037502d4c6e to your computer and use it in GitHub Desktop.
Save dineshprabu-freshdesk/cb97a85087f4e4d47b578037502d4c6e to your computer and use it in GitHub Desktop.
Example Search
function search(tag){
// Considering request returns promise.
return request('http://google.com?q='+tag);
}
search('monard')
.then(function(response){
console.log(response);
})
.catch(function(searchError){
console.log(searchError);
});
@geethalladi
Copy link

// I am thinking like this
search = function(tag) { ... }
process = function(results) { ... }

showForTag = compose(search, process)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment