本文整理汇总了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 => {