Angular Instantsearch - Change hitsPerPage dynamically depending on state

Hey all,

I’m playing around with Angular Instantsearch (3.0.0-beta.4) and just wondering how would be possible to change hitsPerPage dynamically?

I have a State and a boolean there - either sidebar is expanded or not. I’m subscribed to that change, but when I change hitsPerPage setting it doesn’t re-render automatically - only happens on a page refresh.

ngOnInit(): void {

    this.ngRedux.select(state => {
      if (!state.sidebarIsExpanded) {

        this.algoliaIndex.setSettings({
          hitsPerPage: 1
        }).then(() => {
          console.log('hitsPerPage changed');
        });

      }
    }).subscribe();

  }

Thank you very much in advance!

PS.: When I was using plain JS, I was achieving the same using Helper.

helper.setQueryParameter('hitsPerPage', 1).search();