angular - Merging multiple FirebaseListObservables with proper sorting -
i writing firebase-based chat web application support feeds multiple rooms. have combinelatest
working (adapted this example:)
let rooms = ['room1', 'room2', 'room3']; let observables = rooms.map((room) => { return this.cs.getmessagesbyroomid(room) }); this.messages = observable.combinelatest( observables, (...rooms) => { console.log('rooms',array.prototype.concat(...rooms)); return array.prototype.concat(...rooms) } );
but not sort posts correctly... merge
should automatically, hope there's way working.
Comments
Post a Comment