twitter / typeahead.js

typeahead.js is a fast and fully-featured autocomplete library
http://twitter.github.io/typeahead.js/
MIT License
16.52k stars 3.21k forks source link

How to clear cache? #1775

Open hervehobbes opened 4 years ago

hervehobbes commented 4 years ago

Hello,

I'm using a local set of data (an array) to search in and I dynamically add or remove some items inside this array, how do I ask the Bloodhound to refresh its cache?

viking2917 commented 4 years ago

For posterity, as I had the same issue: (this clears the cache associated with remote calls; not entirely sure about local data sets...)

let bloodhound = new Bloodhound({...});

later, to clear the cache:

bloodhound.clearRemoteCache();