corejavascript / corejavascript/typeahead.js

rateLimitBy, rateLimitWait without Blooodhound

Open
#76 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
968
Forks
231
PR merge metrics
No merged PRs in 30d

Description

I originally posted [here](https://github.com/twitter/typeahead.js/issues/1504) since I didn't realize this was the maintained fork.

I understand that Bloodhound and Typeahead are decoupled and in my particular case, the database is already providing ranking for the results, so I don't really need Bloodhound. However, I'd like to be able to throttle GET requests when typing. Is there some way to do it without Bloodhound? This is what I have so far:

```
$('.typeahead').typeahead({
highlight: true,
hint: false,
}, {
name: 'search',
display: 'value',
limit: 10,
source: function(query, syncResults, asyncResults) {
$.get('http://localhost:8000/search/' + query, function(data) {

data = $.map(data['values'], function(value) {
return {
value: value
};
})
asyncResults(data);
});
}
})
```

Assuming it is not possible to do it without Bloodhound, what is the minimal setup needed to provide `rateLimitBy`, `rateLimitWait` without unnecessary additional work.

Thank you

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.