Skip to content

Instantly share code, notes, and snippets.

@remy remy/example.js Secret
Created Jun 1, 2019

Embed
What would you like to do?
An example shim for firebase-admin using REST calls under the hood.
module.exports = {
ref(path) {
return {
async transaction(transform) {
const token = await getToken();
const res = await get({ path, token });
return put({ path, token, data: transform(res) });
},
child(key) {
return {
async set(data) {
const token = await getToken();
return put({ path: `${path}/${key}`, data, token });
},
};
},
};
},
};
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.