Appreciating that firebase has added support for promises, is there a way to run a query like the following inside of an async
function?:
const eventref = this.db.ref('cats/whiskers');
const value = await eventref.once('value')
Running the above returns a promise for value
, I'm hoping to get the json blob that is stored at cats/whiskers
.
await
cannot return thenables. Do you use a transpiler? Have you inspected what theeventref.once('value')
looks like in a debugger? – Apostrophe.val()
call in the await statement, this worked for me, too. – Brewer.once
works but.on
(sosomeRef.on('child_added')
) expects a second argument. Any ideas for that? – Turro