@nodeart/firebase-connector
Advanced tools
Comparing version 2.1.15 to 2.1.16
@@ -36,3 +36,3 @@ { | ||
}, | ||
"version": "2.1.15" | ||
"version": "2.1.16" | ||
} |
@@ -557,2 +557,17 @@ import { Http, Response } from '@angular/http'; | ||
} | ||
/** | ||
* Emits order object when new order added | ||
* | ||
* @returns {Observable} Observable of new order | ||
*/ | ||
listenOrders() : Observable<any>{ | ||
return Observable.create( observer => { | ||
firebase.database().ref('orders').on('child_added', newOrder => { | ||
if(newOrder.val()){ | ||
observer.next(newOrder.val()); | ||
} | ||
}); | ||
}) | ||
} | ||
} |
31263
762