當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。