本文整理汇总了TypeScript中rxjs/Rx.Subject.complete方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Subject.complete方法的具体用法?TypeScript Subject.complete怎么用?TypeScript Subject.complete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rxjs/Rx.Subject
的用法示例。
在下文中一共展示了Subject.complete方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: Error
.toArray((err: MongoError, users: Array<IUser>): void => {
if (err) {
throw new Error(err.message);
}
subject.next(users);
subject.complete();
});
示例2: ObjectID
collection.find({ _id: new ObjectID(id) }).limit(1).next((err: MongoError, user: TEntity): void => {
if (err) {
throw new Error(err.message);
}
subject.next(user);
subject.complete();
});
示例3: Error
collection.insertOne(entity, (err: WriteError, result: InsertOneWriteOpResult) => {
if (err) {
throw new Error(err.errmsg);
}
entity._id = result.insertedId.toHexString();
subject.next(entity);
subject.complete();
});
示例4: setTimeout
setTimeout(() => {
const index = route.params['id'] - 1;
const course = coursesData.courses[index];
subject.next(course ? !course.pro : true);
subject.complete();
});
示例5: open
public open(message?: string): Observable<any> {
if (message && message.length > 0) {
this.message = message;
}
this.dialog.nativeElement.open();
if (this._subject) {
this._subject.complete();
}
this._subject = new Subject<boolean>();
return this._subject.asObservable();
}
示例6:
err => {
subject.error(err);
subject.complete();
}
示例7: onClose
protected onClose(event: any) {
this._subject.next(event.detail.confirmed);
this._subject.complete();
this._subject = null;
}
示例8:
let callback = (error:any, response:any) => {
if(error) subject$.error(error);
subject$.next(response);
subject$.complete();
};