Created
May 10, 2016 03:56
-
-
Save davidgilbertson/d7bc056170057bc9d16252f42302e4d7 to your computer and use it in GitHub Desktop.
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
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