Skip to content

Instantly share code, notes, and snippets.

@bluejava
Last active June 27, 2019 01:21
Show Gist options
  • Save bluejava/f7617611296db6a0e07e7b6adedf3139 to your computer and use it in GitHub Desktop.
Save bluejava/f7617611296db6a0e07e7b6adedf3139 to your computer and use it in GitHub Desktop.
Example 2 for Medium Post
function getScore() { return 45 }
function double(x) { return x * 2 }
Zousan.evaluate(
{ name: "username", value: "glenn" },
{ name: "score", value: getScore },
{ name: "newScore", value: double, deps: [ "score" ] }
).then(function(ob) {
console.log("Hello " + ob.username + ". Your new score is " + ob.newScore)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment