InfiniteScroll with Redux

I am trying to write my Ionic2 app with Redux(NgRx Store), but I face some problems with components like InfiniteScroll or Refresher. The problem is that i need to stop the loading with infiniteScroll.complete() and I can do this only in the function which is called by the infiniteScroll component. It would be nice if Icould set a flag for loading or something like this.
Does anyone have experience with Redux and Ionic2? How should such usecases be handled properly?

Would you be able to provide a small demo of what you’ve tried so far? Not sure how much help we’d be able to provide without seeing some code

In my component I have something like this:
<ion-infinite-scroll (ionInfinite)=“loadMore($event)”>


The loadMore() function looks like this and calls another function, which does Http calls to the server and dispatches actions to the server like LOAD_POSTS_REQUEST, LOAD_POSTS_SUCCESS, LOAD_POSTS_ERROR
loadMore(infiniteScroll){
this.postService.loadPosts(this.start, this.number);
}
The store has a flag loading and when it chages to false the loader should stop. You can access this flag through an Observable
I solved it by subscribing to the observable, but it seems a bit hacky and like a workaround…
loadMore(infiniteScroll){
this.postService.loadPosts(this.start, this.anzahl);
this.store.let(isPostsLoading()).subscribe(loading => {
if(!loading)
infiniteScroll.complete();
});
}

I hope you can understand what I want more or less.

I cant’t format the code :sweat: