Skip to content

Commit 1341c42

Browse files
expose the pageCleanUpOffset parameter (#208)
1 parent 9ff055a commit 1341c42

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Sources/InstantSearchCore/Hits/HitsInteractor.swift

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,20 @@ public class HitsInteractor<Record: Codable>: AnyHitsInteractor {
4242
}
4343

4444
}
45+
46+
/// Value defines how many pages of hits might be kept in memory
47+
/// before and after the current page
48+
/// When set `nil`, all the fetched pages will stay in memory
49+
/// Default value: 3
50+
public var pageCleanUpOffset: Int? {
51+
get {
52+
return paginator.pageCleanUpOffset
53+
}
54+
55+
set {
56+
paginator.pageCleanUpOffset = newValue
57+
}
58+
}
4559

4660
convenience public init(infiniteScrolling: InfiniteScrolling = Constants.Defaults.infiniteScrolling,
4761
showItemsOnEmptyQuery: Bool = Constants.Defaults.showItemsOnEmptyQuery) {

0 commit comments

Comments
 (0)