本文整理匯總了TypeScript中angularfire2/database.snapshotChanges函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript snapshotChanges函數的具體用法?TypeScript snapshotChanges怎麽用?TypeScript snapshotChanges使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了snapshotChanges函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it('should handle empty sets', done => {
const aref = createRef(rando());
aref.set({});
snapshotChanges(aref).pipe(take(1)).subscribe(data => {
expect(data.length).toEqual(0);
}).add(done);
});
示例2: prepareSnapshotChanges
function prepareSnapshotChanges(opts: { events?: ChildEvent[], skipnumber: number } = { skipnumber: 0 }) {
const { events, skipnumber } = opts;
const aref = createRef(rando());
const snapChanges = snapshotChanges(aref, events);
return {
snapChanges: snapChanges.pipe(skip(skipnumber)),
ref: aref
};
}
示例3: snapshotChanges
namefilter$.pipe(switchMap(name => {
const filteredRef = name ? aref.child('name').equalTo(name) : aref
return snapshotChanges(filteredRef);
}),take(2)).subscribe(data => {