本文整理匯總了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();
};