Last active
August 29, 2015 14:17
-
-
Save morizotter/a942577bd5b69a825c73 to your computer and use it in GitHub Desktop.
typeaheadのprefetchが動いていないように見える件 ref: http://qiita.com/morizotter/items/bffd0e256cd4e21e9324
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var engine = new Bloodhound({ | |
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'), | |
queryTokenizer: Bloodhound.tokenizers.whitespace, | |
prefetch: { | |
url: "stations.json", | |
cacheKey: "change here!" | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
engine.clearPrefetchCache(); | |
engine.initialize() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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