本文整理匯總了TypeScript中rxjs/Rx.Subscriber.complete方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Subscriber.complete方法的具體用法?TypeScript Subscriber.complete怎麽用?TypeScript Subscriber.complete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類rxjs/Rx.Subscriber
的用法示例。
在下文中一共展示了Subscriber.complete方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: registerDbListeners
/**
* registerDbListeners()
*
* ref: https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB#Version_changes_while_a_web_app_is_open_in_another_tab
* ref: https://developer.mozilla.org/en-US/docs/Web/API/IDBObjectStore
*/
private registerDbListeners(observer: Subscriber<any>, database: IDBDatabase){
// onerror and onabort are listed as part of the definitions...
database.onerror = (ev:Event) => {
this.logEvent("db", ev)
};
database.onabort = (ev:Event) => {
this.logEvent("db", ev)
};
// onversionchange and onclose are listed object properties in Chrome
database.onversionchange = (ev:Event) => {
this.logEvent("db", ev)
database.close();
observer.error("IndexedDB schema version changed. Reload window is suggested")
};
database.onclose = (ev:Event) => {
this.logEvent("db", ev)
};
observer.next(database)
observer.complete()
}
示例2: insertRecord
const insertRecord = () => {
if ( i < recordList.length) {
let request:IDBRequest;
if (keyList) {
request = store.add(recordList[i], keyList[i])
} else {
request = store.add(recordList[i])
}
request.onsuccess = (ev:Event) => {
this.logEvent("insertBatch", ev)
observer.next(i)
insertRecord()
};
request.onerror = (ev:Event) => {
this.logEvent("insertBatch", ev)
observer.error(ev.target.error)
};
++i
} else {
observer.complete()
}
}
示例3:
self.ref.set(data, (err) => {
if(err != null){
subscriber.error(err);
}else{
subscriber.next({});
subscriber.complete();
}
})
示例4: RxFirebase
var newRef = self.ref.push(data, (err) => {
if(err != null){
subscriber.error(err);
}else{
subscriber.next(new RxFirebase(newRef));
subscriber.complete();
}
})
示例5: setInterval
var handle = setInterval(() => { // tslint:disable-line:no-var-keyword
if (data.length) {
subscriber.next(data.shift());
} else {
subscriber.complete();
clearInterval(handle);
}
}, 1000);
示例6:
var handleSuccess = (ev: Event) => {
this.logEvent('dropDatabase', ev)
if (ev.oldVersion > 0){
observer.next()
observer.complete()
} else {
observer.error(`Cannot find requested database '${databaseName}'`)
}
}
示例7:
}).subscribe((data: {version: string}) => {
obs.next(data.version);
obs.complete();
});
示例8:
this.ws.onopen = event => {
openSubscriber.next();
openSubscriber.complete();
};