Skip to content

Instantly share code, notes, and snippets.

@davidgilbertson
Created May 10, 2016 03:56
Show Gist options
  • Save davidgilbertson/d7bc056170057bc9d16252f42302e4d7 to your computer and use it in GitHub Desktop.
Save davidgilbertson/d7bc056170057bc9d16252f42302e4d7 to your computer and use it in GitHub Desktop.
const cloudDb = new Firebase(FIREBASE_URL);
// ref helper
function getRef(...args) {
return args.reduce((result, key) => result.child(key), cloudDb);
}
// example usage
const box = {some: 'new property'};
const projectId = 1;
const boxId = 2;
getRef('data/projects', projectId, 'boxes', boxId).update(box);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment