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


TypeScript BehaviorSubject.getValue方法代碼示例

本文整理匯總了TypeScript中rxjs/BehaviorSubject.BehaviorSubject.getValue方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript BehaviorSubject.getValue方法的具體用法?TypeScript BehaviorSubject.getValue怎麽用?TypeScript BehaviorSubject.getValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在rxjs/BehaviorSubject.BehaviorSubject的用法示例。


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

示例1: Promise

    return new Promise((resolve) => {

      this.af.database.list('/match/' + uid).subscribe((snapshots) =>{
        this.subject.next(snapshots);
      })

      if(!this.subject.getValue()) {
          this.af.database.list('/match/' + uid).subscribe((snapshots) =>{
            resolve(snapshots);
          });
          return;
      }

      resolve(this.subject.getValue());
    });
開發者ID:projetosuperacao,項目名稱:appsuperacao,代碼行數:15,代碼來源:match-storage-service.ts

示例2:

 return Observable.create((observer) => {
   // setTimeout(function() {
   this._todos.getValue().push(todo);
   observer.next(true);
   observer.complete();
   // }, timeout);
 });
開發者ID:bradseefeld,項目名稱:ng2-todo,代碼行數:7,代碼來源:todo.service.ts

示例3: buildPath

    buildPath(): void {
        let strategy = new TerrainPathFindingStrategy(this.grid);
        let astar = new AStar(strategy);
        let startCell = this.grid.getCell(this.startIndex);
        let finishCell = this.grid.getCell(this.finishIndex);
        let path = astar.GetPath(startCell, finishCell);
        if (path.length > 0) {
            path = [
                startCell,
                ...
                path
            ];
        }

        let pathChange: PathChangeEvent = {
            currentPathIndexes: path.map(c => c.cellIndex),
            oldPathIndexes: this.pathIndexesSubject.getValue().currentPathIndexes
        };

        this.pathIndexesSubject.next(pathChange);
    }
開發者ID:megaboich,項目名稱:a-star-typescript,代碼行數:21,代碼來源:game.ts

示例4: updateState

 private updateState(f: (x: CarState) => void) {
   let newState: CarState = Object.assign({}, this.state$.getValue());
   f(newState);
   this.calculateValidity(newState);
   this.state$.next(newState);
 }
開發者ID:AnimalStyle55,項目名稱:Angular2,代碼行數:6,代碼來源:car-state.service.ts

示例5: getSquare

 /*
 *   Gets a square at a certain position
 */
 getSquare(x: number, y: number): Square {
     if(this.field.getValue()[y])
         return this.field.getValue()[y][x];
 }
開發者ID:robinsoepboer,項目名稱:minesweeper,代碼行數:7,代碼來源:minefield.service.ts

示例6: getState

 getState() {
   return this.subject.getValue();
 }
開發者ID:arpitsaan,項目名稱:ShapeShifter,代碼行數:3,代碼來源:MockStore.ts

示例7: first

 /**
  * @return first
  */
 get first() {
   return this._first.getValue();
 }
開發者ID:openfact,項目名稱:openfact-web-console,代碼行數:6,代碼來源:pagination.store.ts

示例8: finishIndex

 public get finishIndex() {
     return this.finishIndexSubject.getValue().currentIndex;
 }
開發者ID:megaboich,項目名稱:a-star-typescript,代碼行數:3,代碼來源:game.ts

示例9: from

 get from() {
   return this._first.getValue() + 1;
 }
開發者ID:openfact,項目名稱:openfact-web-console,代碼行數:3,代碼來源:pagination.store.ts

示例10: totalPages

 get totalPages() {
   return Math.ceil(this._totalResults.getValue() / this.pageSize);
 }
開發者ID:openfact,項目名稱:openfact-web-console,代碼行數:3,代碼來源:pagination.store.ts


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