Skip to content

Commit 273e30d

Browse files
committed
Clarify function and variable names
1 parent 230ff1b commit 273e30d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/index.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var Settings = require('./settings');
66
var util = require('./util');
77
var throttle = require('./throttle');
88

9-
var API_THROTTLE = 200;
9+
var API_THROTTLE_TIME_MS = 200;
1010

1111
var client = function(sitekey) {
1212
this.sitekey = sitekey;
@@ -49,7 +49,7 @@ var client = function(sitekey) {
4949
this.settings.setKeyword(keyword);
5050

5151
if (!this.throttledSearchFetch) {
52-
this.throttledSearchFetch = throttle(API_THROTTLE, executeApiFetch);
52+
this.throttledSearchFetch = throttle(API_THROTTLE_TIME_MS, executeApiFetch);
5353
}
5454
this.throttledSearchFetch(this.sitekey, 'search', this.settings.getSettings(), callback);
5555
}
@@ -67,7 +67,7 @@ var client = function(sitekey) {
6767
this.settings.setSuggestionsPrefix(prefix);
6868

6969
if (!this.throttledSuggestionsFetch) {
70-
this.throttledSuggestionsFetch = throttle(API_THROTTLE, executeApiFetch);
70+
this.throttledSuggestionsFetch = throttle(API_THROTTLE_TIME_MS, executeApiFetch);
7171
}
7272
this.throttledSuggestionsFetch(this.sitekey, 'suggest', this.settings.getSettings(), callback);
7373
}
@@ -85,7 +85,7 @@ var client = function(sitekey) {
8585
this.settings.setAutocompleteParams(field, prefix);
8686

8787
if (!this.throttledAutocompleteFetch) {
88-
this.throttledAutocompleteFetch = throttle(API_THROTTLE, executeApiFetch);
88+
this.throttledAutocompleteFetch = throttle(API_THROTTLE_TIME_MS, executeApiFetch);
8989
}
9090
this.throttledAutocompleteFetch(this.sitekey, 'autocomplete', this.settings.getSettings(), callback);
9191
}
@@ -116,7 +116,7 @@ var client = function(sitekey) {
116116
this.setShuffleAndLimitTo = function(shuffleAndLimitTo) { this.settings.setShuffleAndLimitTo(shuffleAndLimitTo); }
117117
this.setFuzzyMatch = function(fuzzy) { this.settings.setFuzzyMatch(fuzzy); }
118118
this.setCollectAnalytics = function(collectAnalytics) { this.settings.setCollectAnalytics(collectAnalytics); }
119-
this.setThrottleDelay = function(delay) { API_THROTTLE = delay; }
119+
this.setThrottleTime = function(delay) { API_THROTTLE_TIME_MS = delay; }
120120
this.setStatsSessionId = function(id) { this.sessionId = id; }
121121
this.getStatsSessionId = function() { return this.sessionId; }
122122

0 commit comments

Comments
 (0)