-
Notifications
You must be signed in to change notification settings - Fork 72
Closed
Description
Apologies if this is outside the scope of this, but I'm attempting to port an application across from AngularJS to React and hoping there may be a solution here.
So my RTDB structure is set up as follows:
-customers
-customer1
-orders
-key1:true
-key2:true
-key3:true
-orders
-key1
-key2
-key3
Previously with AngularFire (for AngularJs) I could use the $extend functionality allowing me to return an array of Firebase objects with:
var customerOrders = firebase.database().ref('customers/' + customerId + '/orders/');
var orders = firebase.database().ref('orders');
var OrdersList = $firebaseArray.$extend({
$$added: function (snap) {
return new Promise(function (resolve, reject) {
$firebaseObject(orders.child(snap.key)).$loaded().then(function (orderData) {
resolve(orderData);
}).catch(reject);
});
}
});
return new OrdersList(customerOrders);
Metadata
Metadata
Assignees
Labels
No labels