Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: SwiftUI infinite scrolling issue #228

Merged
merged 5 commits into from
Jul 6, 2022

Conversation

VladislavFitz
Copy link
Contributor

Summary

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.

@VladislavFitz VladislavFitz changed the title fix: SwiftUI infinite scrolling fix: SwiftUI infinite scrolling issue Jun 24, 2022
@VladislavFitz VladislavFitz force-pushed the fix/swiftui-infinite-scrolling branch from f045faa to e7bfd0b Compare June 27, 2022 12:38
@VladislavFitz VladislavFitz merged commit 6f924e3 into master Jul 6, 2022
@VladislavFitz VladislavFitz deleted the fix/swiftui-infinite-scrolling branch August 4, 2022 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants