当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript Observer.complete方法代码示例

本文整理汇总了TypeScript中rxjs/Rx.Observer.complete方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Observer.complete方法的具体用法?TypeScript Observer.complete怎么用?TypeScript Observer.complete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在rxjs/Rx.Observer的用法示例。


在下文中一共展示了Observer.complete方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1:

 position => {
   const coordinate: Coordinate = {
     latitude: position.coords.latitude,
     longitude: position.coords.longitude
   };
   observer.next(coordinate);
   observer.complete();
 },
开发者ID:cristianrgreco,项目名称:nearby-pokemon,代码行数:8,代码来源:location.service.ts

示例2:

 xhr.onreadystatechange = () => {
   if (xhr.readyState === 4) {
     if (xhr.status === 200) {
       observer.next("test");
       observer.complete();
     } else {
       observer.error(xhr.response);
     }
   }
 };
开发者ID:icebluetech,项目名称:process-improvement-app,代码行数:10,代码来源:data.ts

示例3:

 let obs: Observable<any> = Observable.create((observer: Observer<any>) => {
   if (user.Email == "arun.thakur@mail.com" && user.Password == "123456") {
     observer.next(true);
   }
   else {
     observer.error("Invalid Credentials");
   }
   observer.complete();
   //return () => { console.log("disposable called..."); }; //dispose observable
 });
开发者ID:thakurarun,项目名称:listit,代码行数:10,代码来源:userService.ts

示例4:

			}).then((cmpRef: ComponentRef<TooltipComponent>) => {
				// Store reference to TooltipComponent
				this._toolTipCmp = cmpRef;

				// Append it to DOM
				this.viewContainer.element.nativeElement.appendChild(cmpRef.location.nativeElement);

				// Resolve the component
				observer.next(this._toolTipCmp);
				observer.complete();
			});
开发者ID:cviccaro,项目名称:jpa-admin,代码行数:11,代码来源:provider.ts

示例5: function

 req.onload = function() {
     if (req.status == 200) {
     // If the status is 200, meaning there have been no problems,
     // Yield the result to listeners and complete the sequence
         observer.next(req.response);
         observer.complete();
     }
     else {
     // Otherwise, signal to listeners that there has been an error
         observer.error(new Error(req.statusText));
     }
 };
开发者ID:MOHAMMADArsalan,项目名称:learn-typed-rxjs,代码行数:12,代码来源:main.ts

示例6:

 (observer: Observer<any>) => {
   if (!this.needsUpdate(url)) {
     observer.next(this.cacheMap[url].data);
     observer.complete();
   }
   this.call("get", url).subscribe(
     res => {
       this.storeData(url, res.json());
       observer.next(this.cacheMap[url].data);
       observer.complete();
     }
   );
 }
开发者ID:audifaxdev,项目名称:ng2-restservice,代码行数:13,代码来源:RestService.ts

示例7: Headers

        return Observable.create((observer: Observer<any>) => {
            if (this.authService.getToken() != null) {
                let headers = new Headers();
                headers.append('Authorization', `Bearer ${this.authService.getToken()}`);

                if (!pullRequest.merge_commit) {
                    observer.error(new Error('Impossible to get PR diff from the API'));
                    observer.complete();
                } else {
                    this.http.get(this.repoUrl + '/diff/' + pullRequest.merge_commit.hash, { headers: headers })
                    .subscribe(
                        (diffResponse: any) => {
                            observer.next(diffResponse._body);
                            observer.complete();
                        },
                        err => {
                            observer.error(err);
                        }
                    );
                }
            } else {
                observer.error('no token');
            }
        });
开发者ID:vnctaing,项目名称:stethoscope,代码行数:24,代码来源:bitbucket.service.ts

示例8:

 let onLoad = (event) => {
   // console.log('xhr complete', event);
   responseObserver.complete();
 };
开发者ID:StudioProcess,项目名称:imagetool,代码行数:4,代码来源:xhr-custom.ts

示例9: removeDomListener

 }, error => {
     observer.error(error);
     removeDomListener();
     observer.complete();
 }, options);
开发者ID:konstantindenerz,项目名称:boardz-cross-platform-sample,代码行数:5,代码来源:mobileCameraService.ts


注:本文中的rxjs/Rx.Observer.complete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。