javascript - Firebase: snap.child(...).once is not a function -


i want listen data firebase first have check if keys leading specific data has been made. if have not yet been made there no problem don't have listen.

i error message:

snip.child(...).once not function

i have tried followed documentation here seems if doing should legal.

the .haschild(...) works fine.

rootref.child('match-feed-comments').once('value', snip => {     if (snip.haschild(this.props.matchid)) { // checking if child exists         snip.child(this.props.matchid).once('value', snup => { // if child exists listen             if (snup.haschild(this.props.feedcomponentid)) {                 snup.child(this.props.feedcomponentid).on('value', snap => {                     // want stuff data                     this.setstate({                         comments: snap.val()                     })                 });             }         });     } }); 


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -