Ionic infinite loading gives duplicate data

hi,
I’m new to Ionic . I need to use infinite scroll in an application ,but i don’t know how to avoid data being duplicating ;
My code is,

{{i.data.after}} {{count}}

<ion-infinite-scroll (ionInfinite)=“doInfinite($event)” >


my ts file is

ionViewDidLoad(){
this.pickData()
}
pickData(){
this.http.get(‘https://www.reddit.com/r/gifs/top/.json?limit=105sort=hot’, {}).map(res =>{
console.log(res.json()); res.json();
for(let i=0;i<20;i++)
this.items.push(res.json())
})
.subscribe(data => {
//this.items=data;
console.log(this.items+’ '+data ,“setg”)
});

}
doInfinite(infiniteScroll) {
setTimeout(() => {
this.pickData()
infiniteScroll.complete();
}, 3000);
}

Set the limit of the Reddit API request to 20 and use before and after to avoid duplicates.
See the documentation here:
https://www.reddit.com/dev/api/#GET_hot