Last active
May 19, 2016 20:50
-
-
Save SeanChristopherConway/ebc0ae75dfef86cfbce97607a92734c1 to your computer and use it in GitHub Desktop.
EmbeddedCallback
This file contains 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
_ = require('underscore'); | |
var fakeServerCall = function (obj) { | |
if (obj && obj.id) { | |
return { | |
state: true | |
}; | |
} | |
}; | |
var truthTest = function (data) { | |
console.log(JSON.stringify(data)); | |
if (data.state) { | |
console.log("You have passed the truth test"); | |
} else { | |
console.log("You have not passed the truth test"); | |
} | |
}; | |
var composedFunction = _.compose(truthTest,fakeServerCall); | |
composedFunction({ | |
id: 1 | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment