本文整理汇总了TypeScript中@angular/fire/database-deprecated.FirebaseListObservable.push方法的典型用法代码示例。如果您正苦于以下问题:TypeScript FirebaseListObservable.push方法的具体用法?TypeScript FirebaseListObservable.push怎么用?TypeScript FirebaseListObservable.push使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类@angular/fire/database-deprecated.FirebaseListObservable
的用法示例。
在下文中一共展示了FirebaseListObservable.push方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: expect
(list: any) => {
if (prev) {
expect(list[0]).toBe(prev[0]);
done();
} else {
prev = list;
questionsSnapshotted.push({ name: 'bob' });
}
},
示例2: skipAndTake
.then(() => {
let calls: string[] = [];
questions.$ref.ref.once('child_added', (snap) => calls.push('child_added:' + snap.val().number));
skipAndTake(questions).subscribe(
(list: any) => {
expect(calls).toEqual(['child_added:2', 'pushed']);
expect(list.map((i: any) => i.number)).toEqual([1, 2]);
done();
},
done.fail
);
questions.push({ number: 2 });
calls.push('pushed');
})
示例3: it
it('should re-emit identical instances of unchanged children as snapshots', (done: any) => {
let prev: any;
take.call(questionsSnapshotted, 2).subscribe(
(list: any) => {
if (prev) {
expect(list[0]).toBe(prev[0]);
done();
} else {
prev = list;
questionsSnapshotted.push({ name: 'bob' });
}
},
done.fail
);
questionsSnapshotted.push({ name: 'alice' });
});