使用onScrollMore事件侦听器和fetchMore进行无限滚动分页

时间:2018-09-20 05:20:16

标签: javascript apollo react-apollo

 public downloadFile(link: any, fileName: any) {
      if (link) {
        let path = null;
        this.showWaitingLoading();
        if (this.platform.is('ios')) {
          path = this.file.documentsDirectory;
        } else {
          path = this.file.dataDirectory;
      }

      const transfer = this.transfer.create();

      transfer.download(link, path + fileName).then(entry => {
        this.dismissWaitingLoading();
        this.openFile(entry.toURL());
      }).catch(() => {
        this.dismissWaitingLoading();
        this.showToastMsg('error', "Something went wrong");
      });
     }
    }
/* ================= OPNE FILE FUNCTION ===========*/

public openFile(path: any) {
   this.fileOpener.open(path, 'application/*')
     .then(() => console.log('File is opened'))
     .catch((e: any) => console.log('Error openening file', e));
}

这是阿波罗文档中的一部分代码。我对一些道具感到困惑吗?是onLoadMore一个javascript事件侦听器吗?我一生中从未见过这种情况。对于此游标,应如何在后端实现它?关于updateQuery是否有更好的文档,它有什么作用?输入返回到fetchMore函数,这是做什么的?

0 个答案:

没有答案