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


TypeScript Subject.complete方法代码示例

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


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

示例1: switch

                message: (message) => {
                    console.debug('Received from server the following : ', message['data']['data']);

                    const communication: ServerCommunication = message['data']['data'];

                    switch(communication['type']){

                        case 'question':
                            this._questions.next(communication);
                            break;

                        case 'notification':
                            console.log('received a notif');
                            this._notifs.next(communication);
                            break;

                        case 'scores':
                            this._scores.next(communication['content']);
                            break;

                        case 'complete':
                            this._questions.complete();
                            break;

                        default:
                            console.log('Type of the communication unknown');
                            break;
                    }
                },
开发者ID:aGautrain,项目名称:ZetaPush-quizz,代码行数:29,代码来源:quizz.service.ts

示例2: setTimeout

        setTimeout(() => {
            UserMock.firstName = user.firstName;
            UserMock.lastName = user.lastName;
            UserMock.email = user.email;

            subject.next(UserMock);
            subject.complete();
        }, 1000);
开发者ID:gdyrrahitis,项目名称:101-Angular-2.0-Samples,代码行数:8,代码来源:forms.reactive.authorization.service.ts

示例3: it

    it('should wait for all observables to complete and then provide their final values', () => {
      const subject1 = new Subject<string>();
      const subject2 = new Subject<string>();

      const observable = Observable.forkJoin(subject1, subject2);
      const log = [];
      observable.subscribe(next => log.push(next));

      subject1.next('hello');
      expect(log).toEqual([]);

      subject2.next('world');
      expect(log).toEqual([]);

      subject1.complete();
      expect(log).toEqual([]);

      subject2.complete();
      expect(log).toEqual([['hello', 'world']]);
    });
开发者ID:loki2302,项目名称:html5-experiment,代码行数:20,代码来源:rxjs.spec.ts

示例4: isAuto

 let subscription = timer.subscribe(() => {
   let meteorUser = Meteor.user();
   if (meteorUser) {
     subject.next( LoginActions.loginSuccessFactory(
       this.userFromMeteorUser(meteorUser),
       meteorUser._id,
       isAuto(lastLoginState)
     ));
     subject.complete();
     subscription.unsubscribe();
   }
 });
开发者ID:kokokenada,项目名称:for-real-cards,代码行数:12,代码来源:login-service-meteor.ts

示例5: afterEach

 afterEach(function() {
   routeSet$.complete();
 });
开发者ID:SekibOmazic,项目名称:router,代码行数:3,代码来源:redirect.spec.ts

示例6:

			()=>
				out.complete()
开发者ID:ArtwareSoft,项目名称:jbart5-ng,代码行数:2,代码来源:jb-rx.ts

示例7: afterEach

 afterEach(function() {
   routerInstruction$.complete();
 });
开发者ID:danielsef,项目名称:router,代码行数:3,代码来源:params.spec.ts

示例8:

 this.image.onload = () => {
   this.imageLoadSubject.next(null);
   this.imageLoadSubject.complete();
 };
开发者ID:ckile,项目名称:GoldenVoyage,代码行数:4,代码来源:gvCardBlurHelper.service.ts


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