当前位置: 首页>>代码示例>>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;未经允许,请勿转载。