Created
November 13, 2017 05:27
-
-
Save dineshprabu-freshdesk/cb97a85087f4e4d47b578037502d4c6e to your computer and use it in GitHub Desktop.
Example Search
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
// I am thinking like this
search = function(tag) { ... }
process = function(results) { ... }
showForTag = compose(search, process)