I'm working on this legacy React project which we're trying to redesign, it was using default Pagination in Searchkit to view results from Elasticsearch.
Now for redesign purposes we need to replace it with a "Show More button" instead of clicking on the page number.
Is anyone familiar with using searchkit in 2020? I still can't grasp the Accessor concept and extending an Accessor Class or it's methods as: defineAccessor
or buildOwnQuery
.
I want to build a button that fetches data starting from a number and accumulates on it, if i have access to state or the results are in my own store i would've done that but the docs don't say much.
Asked
Active
Viewed 174 times
1

Abdelrhman Yousry
- 31
- 5
1 Answers
1
I figured a solution by storing results onResultsChange and default storing type is to "replace", and on Clicking on "Load More" button the storage type will be changed to "push" new results.
I used accessor's onStateChange
method to reset page number on any change by other filters, and after each result change will reset the storage type back to "replace" to be used by other filters.

Abdelrhman Yousry
- 31
- 5
-
1Do you have an example of your code? I'm hitting the same problem. – inostia Aug 03 '20 at 23:40