Skip to content

Instantly share code, notes, and snippets.

@morizotter
Last active August 29, 2015 14:17
Show Gist options
  • Save morizotter/a942577bd5b69a825c73 to your computer and use it in GitHub Desktop.
Save morizotter/a942577bd5b69a825c73 to your computer and use it in GitHub Desktop.
typeaheadのprefetchが動いていないように見える件 ref: http://qiita.com/morizotter/items/bffd0e256cd4e21e9324
var engine = new Bloodhound({
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'),
queryTokenizer: Bloodhound.tokenizers.whitespace,
prefetch: {
url: "stations.json",
cacheKey: "change here!"
}
});
engine.clearPrefetchCache();
engine.initialize()
var promise = engine.initialize();
promise.done(function(){
booklets.clearPrefetchCache();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment