meteorhacks / search-source

Reactive Data Source for Search
MIT License
146 stars 33 forks source link

searching in `rendered` with an empty string #28

Open lorensr opened 9 years ago

lorensr commented 9 years ago

On https://bulletproofmeteor.com/database-modeling/building-a-real-world-search-app-meteor-package-search/2

you have

Template.searchResult.rendered = function() {
  PackageSearch.search('');
};

But when I take this line out, it seems to still work. Is this line helpful? If so, why? (And it should be added to the README if it should be there.)

pauljohncleary commented 8 years ago

The search won't send a request automatically, hence if you have a default set of results to show before the user types in the search box, you need to initialise the search with a blank string to get your first set of results.

If anyone has a better way of doing this let me know.