matteodem / meteor-easy-search

Easy-to-use search for Meteor with Blaze Components
MIT License
435 stars 68 forks source link

Is it possible to get ifSearching directly from the index? #649

Closed little-brain closed 4 years ago

little-brain commented 4 years ago

Hi, I'm using Easy Search in a React frontend.

The search cursor is inside withTracker and looks like this:

const cursor = MyIndex.search(searchTerm);

Is there any way to get the ifSearching status from the index, so I can use that as a reactive property? I don't have Blaze components.

Thank you.

matteodem commented 4 years ago

You can use the logic as defined in the component package:

https://github.com/matteodem/meteor-easy-search/blob/fe22f092e128358610f6d0b6e40cf632fb5cd411/packages/easysearch_components/lib/if-searching/if-searching.js#L14

The name parameter is optional.