The existing implementation of HitsObservableController uses getCurrentHits function of HitsInteractor to build an observable list of hits. That's why the infinite scrolling didn't work correctly due optimization which keeps only 4 most recents pages of hits in memory.
This PR adds hits computed property in HitsInteractor which ensures the correct hits pages to hits list by presenting the hits of unloaded pages as nil values.
Result
Inifinite scrolling works correctly with HitsObservableController.
Summary
The existing implementation of
HitsObservableController
usesgetCurrentHits
function ofHitsInteractor
to build an observable list of hits. That's why the infinite scrolling didn't work correctly due optimization which keeps only 4 most recents pages of hits in memory. This PR addshits
computed property inHitsInteractor
which ensures the correct hits pages to hits list by presenting the hits of unloaded pages asnil
values.Result
Inifinite scrolling works correctly with
HitsObservableController
.