Page MenuHomePhabricator

Change area object
Open, Needs TriagePublic

Description

The below code is what I have to do get the full data on an area.
The original getAreas() call should include the spread and rep fields as well as a description field

this.areaService.getAreas()
.takeUntil(this.componentDestroyed)
.subscribe(areas => {
  this.areas = [];

  for (let i = 0; i < areas.length; i++) {
    this.areaService.getAreaRep(areas[i].name)
      .takeUntil(this.componentDestroyed)
      .subscribe(result => {
        let area;
        area = new Area(
          areas[i].name,
          areas[i].displayname,
          result.reputation,
          result.spread
        );

        this.areas.push(area);
        this.cdRef.detectChanges();
    });
  }
});

Event Timeline