appbaseio / reactivesearch

Search UI components for React and Vue
https://opensource.appbase.io/reactivesearch
Apache License 2.0
4.89k stars 466 forks source link

Hooks/lifecycle methods when elasticsearch hits are retrieved in ReactiveList? #501

Closed carlopascual closed 6 years ago

carlopascual commented 6 years ago

Issue Type: Bug/Question

Platform: Web

Description: Hi! Thanks again for all your hard work! Really appreciate it :)

I was wondering if there are any lifecycle methods for when the ReactiveList recieves any hits?

I am creating a ReactiveList that is dependent on a DataSearch component where the list renders nothing if the DataSearch has no value, and it renders the results or no results found if there are any hits.

I attempted to try setting a visibility state on value change, but the query would arrive too late and would show the match_all results for a short second then the actual results. This would have the search results flicker.

I also tried setting my visibility state on can not put my checks on onShowResultStats (since when get the results, you have completed the query) and on onAllData, but these are renders, so this is not possible.

Is there any way to get around this? Thanks!

Reactivesearch version: 2.8.2

carlopascual commented 6 years ago

Have done extra research. Will create a clearer issue.