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


TypeScript Subscription.unsubscribe方法代码示例

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


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

示例1:

 this.taskListService.getUserLists().subscribe((taskListsObservable) => {
   if (this.taskListsSubscription != null) {
     this.taskListsSubscription.unsubscribe();
   }
   this.taskListsSubscription =
       taskListsObservable.subscribe((taskLists) => { this.taskLists = taskLists; });
 });
开发者ID:hanaum,项目名称:choose_to_go,代码行数:7,代码来源:userListView.component.ts

示例2: ngOnDestroy

 ngOnDestroy()
 {
    const me = this.constructor.name + '.ngOnDestroy(): ';
    console.log( me);
    if (this._currentClusterSubscription)
       this._currentClusterSubscription.unsubscribe();
 }
开发者ID:JohnL4,项目名称:Diaspora,代码行数:7,代码来源:cluster-details.component.ts

示例3: runPreIFrameTasks

 runPreIFrameTasks() {
     if (this._preIFrameTasks && this._preIFrameTasks.isUnsubscribed) {
         this._preIFrameTasks.unsubscribe();
     }
     this._preIFrameTasks = Observable.timer(0, 60000)
         .concatMap<string>(() => this._http.get('api/token?plaintext=true').retry(5).map<string>(r => r.text()))
         .subscribe(t => this._userService.setToken(t));
 }
开发者ID:rumnha,项目名称:AzureFunctionsPortal,代码行数:8,代码来源:background-tasks.service.ts

示例4:

 (navTabName: string) => {
     if( navTabName !== name && !this.vhostTreeSubs.isUnsubscribed ) { // 플레이어 탭이 아닐 때
         this.vhostTreeSubs.unsubscribe();
         this.stopAllPlayers();
     }
     else {
         this.subscribeVhostTree();
         this.reloadAllPlayers();
     }
 }
开发者ID:BaeHongil,项目名称:VMS,代码行数:10,代码来源:players.component.ts

示例5: Subscription

    return Observable.create(o => {
      log.debug(
        `Doing a RPC to [${remoteProcedure}]. Is connected [${this
          .isConnected}]`
      )

      const disposables = new Subscription()
      if (!this.isConnected) {
        o.error(
          new Error(
            `Session not connected, can\'t perform remoteProcedure ${remoteProcedure}`
          )
        )
        return disposables
      }
      let isDisposed
      const dto = [
        {
          payload,
          replyTo: responseTopic,
          Username: this.userName
        }
      ]

      this.autobahn.session.call(remoteProcedure, dto).then(
        result => {
          if (!isDisposed) {
            o.next(result)
            o.complete()
          } else {
            log.verbose(
              `Ignoring response for remoteProcedure [${remoteProcedure}] as stream disposed`
            )
          }
        },
        error => {
          if (!isDisposed) {
            o.error(error)
          } else {
            log.error(
              `Ignoring error for remoteProcedure [${remoteProcedure}] as stream disposed.`,
              error
            )
          }
        }
      )

      const sub = new Subscription()
      sub.unsubscribe()
      disposables.add(sub)

      return disposables
    })
开发者ID:carlosrfernandez,项目名称:ReactiveTraderCloud,代码行数:53,代码来源:connection.ts

示例6: removePreLoader

  private removePreLoader() {
    if(document) {
      let $body = document.body;
      let preloader = document.getElementById('preloader');
      if(preloader) {
        $body.removeChild(preloader);
        this.routeEventsSubscription.unsubscribe();
      }
      $body.classList.remove('loading');

    }
  }
开发者ID:HerringtonDarkholme,项目名称:Deneb,代码行数:12,代码来源:app.component.ts

示例7: setTimeout

                setTimeout(() => {
                    if (value.indexOf("/") !== -1) {
                        o.next({ noSlashAsync: true });
                    } else {
                        o.next(null);
                    }

                    // wait for bug update. maybe at final release.
                    console.log(v);

                    o.complete();
                    s.unsubscribe();
                }, 1000);
开发者ID:zhaowenjunzz,项目名称:StudyAngular2,代码行数:13,代码来源:custom-validators.ts

示例8: add

  add(teardownSrc: TeardownLogic): Subscription {
    let teardown: any = teardownSrc
    if (this.closed) return this
    if (typeof(teardownSrc) === 'function') teardown = new Subscription(teardown)

    if (this.currentSubscription) {
      this.remove(this.currentSubscription)
      this.currentSubscription.unsubscribe()
      this.currentSubscription = null
    }

    super.add(this.currentSubscription = teardown)
    return this
  }
开发者ID:carlosrfernandez,项目名称:ReactiveTraderCloud,代码行数:14,代码来源:serialSubscription.ts

示例9: runTasks

 runTasks() {
     if (this._tasks && this._tasks.isUnsubscribed) {
         this._tasks.unsubscribe();
     }
     this._tasks = Observable.timer(1, 60000)
     .concatMap<{errors: string[], config: {[key: string]: string}, appSettings: {[key: string]: string} }>(() =>
         Observable.zip(
             this._functionsService.getHostErrors().catch(e => Observable.of([])),
             this._armService.getConfig(this._globalStateService.FunctionContainer),
             this._armService.getFunctionContainerAppSettings(this._globalStateService.FunctionContainer),
             (e,  c, a) => ({errors: e, config: c, appSettings: a})
         )
     )
     .subscribe(result => {
         result.errors.forEach(e => this._broadcastService.broadcast<ErrorEvent>(BroadcastEvent.Error, { message: e, details: `Host Error: ${e}` }));
         this.setDisabled(result.config);
         this._functionsService.setEasyAuth(result.config);
         this._globalStateService.AppSettings = result.appSettings;
         this._broadcastService.broadcast(BroadcastEvent.VersionUpdated);
     });
 }
开发者ID:rumnha,项目名称:AzureFunctionsPortal,代码行数:21,代码来源:background-tasks.service.ts

示例10: ngOnDestroy

 ngOnDestroy() {
   this.taskListsSubscriptionSubscription.unsubscribe();
   if (this.taskListsSubscription != null) {
     this.taskListsSubscription.unsubscribe();
   }
 }
开发者ID:hanaum,项目名称:choose_to_go,代码行数:6,代码来源:userListView.component.ts


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