为什么要一遍又一遍地调用此代码?

时间:2019-05-10 13:40:55

标签: dart flutter reactive-programming rxdart

 PersonBloc(this.blueApi) {
    print('getPeople bloc constructor'); // this gets called once, on construction so therefore i.e. spawning the bloc object non-stop is not the reason
    results = _pageName.asyncMap((page) async {
      print("call"); //this is getting called over and over
      return await blueApi.getPeople(page);
    });
  }

以上代码始终不间断地调用asyncMap((){})内部的内容。有人可以向我解释原因吗?我猜想这在API和电池上一定有点难,所以我需要更改它。我对Reactx一​​无所知。

0 个答案:

没有答案