Skip to content

Instantly share code, notes, and snippets.

@robwormald
Last active August 29, 2015 14:17
Show Gist options
  • Save robwormald/e01ba2035c853fed4c42 to your computer and use it in GitHub Desktop.
Save robwormald/e01ba2035c853fed4c42 to your computer and use it in GitHub Desktop.
//returns array of users
function getUser(){
return fetch('user.json');
}
function getAccountsForUser(user){
return fetch(`users/${user.id}/accounts`);
}
function getPropertiesForAccount(account){
return fetch(`accounts/${account.id}/properties`);
}
function getProfilesForProperty(property){
return fetch(`props/${property.id}/profiles`);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment