當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript meteor-rxjs.MeteorObservable類代碼示例

本文整理匯總了TypeScript中meteor-rxjs.MeteorObservable的典型用法代碼示例。如果您正苦於以下問題:TypeScript MeteorObservable類的具體用法?TypeScript MeteorObservable怎麽用?TypeScript MeteorObservable使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了MeteorObservable類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1:

            .subscribe(poemId => {
                this.poemId = poemId;

                // Subscribe to this poem
                if (this.poemSub) {
                    this.poemSub.unsubscribe();
                }

                this.poemSub = MeteorObservable.subscribe('poems', {}, {
                        poemId: this.poemId
                    })
                .subscribe(() => {
                    this.poem = Poems.findOne(this.poemId);
                });

                // Subscribe to the list of contributors for this poem
                if (this.contributorSub) {
                    this.contributorSub.unsubscribe();
                }

                this.contributorSub = MeteorObservable.subscribe('contributors', this.poemId)
                    .subscribe(() => {
                        this.contributors = Users.find({}).zone();
                    });
            });
開發者ID:babyshoes,項目名稱:exquisite-corpus,代碼行數:25,代碼來源:poem-details.component.ts

示例2: subscribeUsers

  subscribeUsers(): Subscription {
    // Fetch all users matching search pattern
    const subscription = MeteorObservable.subscribe('users', this.searchPattern.getValue());
    const autorun = MeteorObservable.autorun();

    return Observable.merge(subscription, autorun).subscribe(() => {
      this.users = this.findUsers();
    });
  }
開發者ID:ShinFDuran,項目名稱:Pruebas,代碼行數:9,代碼來源:new-chat.ts

示例3: handleRemove

  private handleRemove(alert): void {
    MeteorObservable.call('removeChat', this.params.get('chat')._id).subscribe({
      next: () => {

       alert.dismiss().then(() => {
          this.navCtrl.setRoot(ChatsPage, {}, {
            animate: true
          });
        });
      },

     error: (e: Error) => {
        alert.dismiss().then(() => {
          if (e) {
            return this.handleError(e);
          }

          this.navCtrl.setRoot(ChatsPage, {}, {

           animate: true
          });
        });
      }
    });
  }
開發者ID:ShinFDuran,項目名稱:Pruebas,代碼行數:25,代碼來源:messages-options.ts

示例4: reply

 reply(rsvp: string) {
   MeteorObservable.call('reply', this.track._id, rsvp).subscribe(() => {
     alert('You successfully replied.');
   }, (error) => {
     alert(`Failed to reply due to ${error}`);
   });
 }
開發者ID:harishmaiya,項目名稱:gundmi48-gadikatte58,代碼行數:7,代碼來源:track-details.component.ts

示例5: invite

 invite(user: Meteor.User) {
   MeteorObservable.call('invite', this.track._id, user._id).subscribe(() => {
     alert('User successfully invited.');
   }, (error) => {
     alert(`Failed to invite due to ${error}`);
   });
 }
開發者ID:harishmaiya,項目名稱:gundmi48-gadikatte58,代碼行數:7,代碼來源:track-details.component.ts

示例6: ngOnInit

 ngOnInit() {
   this.usersSub = MeteorObservable.subscribe('pipeUsers').subscribe(() => {
     MeteorObservable.autorun().subscribe(() => {
       this.users = this._userService.findUsers();
     });
   });
 }
開發者ID:michaelb-01,項目名稱:pipe,代碼行數:7,代碼來源:users.component.ts

示例7: ngOnInit

 ngOnInit() {
   MeteorObservable.subscribe('users').subscribe(() => {
     MeteorObservable.autorun().subscribe(() => {
       this.users = this.findUsers().zone();
     });
   });
 }
開發者ID:pro-to-tip,項目名稱:pro-to-tip.github.io,代碼行數:7,代碼來源:new-chat.ts

示例8: ngOnInit

 ngOnInit() {
   this.todos = Todos.find();
   // Subscribe and connect it to Angular's change detection system
   // while running on client
   if (Meteor.isClient)
     this.todoListSubscription = MeteorObservable.subscribe('todoList').subscribe();
 }
開發者ID:Urigo,項目名稱:angular-meteor,代碼行數:7,代碼來源:todo-list.component.ts

示例9:

        this.versionSub = MeteorObservable.subscribe('versions', this.versionId).zone().subscribe(() => {
          MeteorObservable.autorun().subscribe(() => {
            this.version = this._versionService.getVersionById(versionId);

            this.nextVersion = this._versionService.getNextVersion(this.version.entity.entityId, this.version.version, this.version.taskType.type);
            this.prevVersion = this._versionService.getPrevVersion(this.version.entity.entityId, this.version.version, this.version.taskType.type);
          });
        });
開發者ID:michaelb-01,項目名稱:pipe,代碼行數:8,代碼來源:review.component.ts

示例10: done

 done(): void {
   MeteorObservable.call('updateProfile', this.profile).subscribe({
     next: () => {
       this.navCtrl.push(TabsPage);
     },
     error: (e: Error) => {
       this.handleError(e);
     }
   });
 }
開發者ID:pro-to-tip,項目名稱:pro-to-tip.github.io,代碼行數:10,代碼來源:profile.ts


注:本文中的meteor-rxjs.MeteorObservable類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。