Only when the user lifts his finger should refresh performed

Viewed 85

I'm using Refresher component with Ionic 3 app.It is working fine.But now I have a requirement where only when the user lifts his finger should refresh performed, if not, then refresh action is canceled. Do you know how to implement such functionality?

.html

 <ion-refresher (ionRefresh)="getData($event)">
    <ion-refresher-content pullingIcon="arrow-dropdown" pullingText="Pull to refresh" 
     refreshingSpinner="circles" refreshingText="Refreshing...">
    </ion-refresher-content>
  </ion-refresher>

.ts

getData(refresher?: any) {
  Observable.forkJoin([myTopicApi, myarticlApi, myPicksAPi])
      .subscribe(res => {
        if (refresher) { refresher.complete(); }//terminate refresher
      },
      error => {
        if (refresher) { refresher.complete(); }
      },
      () => { if (refresher) { refresher.complete(); } }
      )
}
0 Answers
Related