Skip to content

Instantly share code, notes, and snippets.

@bluejava

bluejava/Example3.js

Last active Jun 27, 2019
Embed
What would you like to do?
Example 3 for Medium Post
function getUser(name) { /* returns Promise of user object */ }
function getFavorites(user) { /* returns Promise of favorites array */ }
Zousan.evaluate(
{ name: "username", value: "glenn" },
{ name: "user", value: getUser, deps: [ "username" ] },
{ name: "favs", value: getFavorites, deps: [ "user" ] }
).then(function(ob) {
renderUserFavs(ob.user, ob.favs)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.