Stop refresh after function is complete

I have this function get_events();

There is a method that i call refresher.complete() when the data in the get_events is loaded?

this is my code

doRefresh(refresher) {
    setTimeout(() => {
      console.log('Async operation has ended');
    }, 1500);

in this case the refresher complete after 1500 ms

Thank You!

What does get_events() returns? A Promise, an Observable?

get_events() {
this.http.get("").subscribe(data => {
  this.todayitems = JSON.parse(data['_body']).today;
  this.afteritems = JSON.parse(data['_body']).after;
  this.sponsoreditems = JSON.parse(data['_body']).sponsored; = this.todayitems.length;


  error => {

    setTimeout(() => {
      let alert = this.alertCtrl.create({
        title: "Nessuna Connessione",
        subTitle: "Si prega di riprovare",
        buttons: ["OK"]
    }, 1000);
    console.log(error);// Error getting the data



You can pass the ‘refresh’ object to the get_events() method and inside the subscribe call the refresh.complete()

But I think this is not a good pattern.
In my opinion, get_events() should return an Observable and the, who calls it deal with the subscribe() and what happens inside.

Thank you can You wrote a good pattern for this section?

I call get_events in the constructor for fill the fields in the html page