@@ -6,7 +6,7 @@ var Settings = require('./settings');
6
6
var util = require ( './util' ) ;
7
7
var throttle = require ( './throttle' ) ;
8
8
9
- var API_THROTTLE = 200 ;
9
+ var API_THROTTLE_TIME_MS = 200 ;
10
10
11
11
var client = function ( sitekey ) {
12
12
this . sitekey = sitekey ;
@@ -49,7 +49,7 @@ var client = function(sitekey) {
49
49
this . settings . setKeyword ( keyword ) ;
50
50
51
51
if ( ! this . throttledSearchFetch ) {
52
- this . throttledSearchFetch = throttle ( API_THROTTLE , executeApiFetch ) ;
52
+ this . throttledSearchFetch = throttle ( API_THROTTLE_TIME_MS , executeApiFetch ) ;
53
53
}
54
54
this . throttledSearchFetch ( this . sitekey , 'search' , this . settings . getSettings ( ) , callback ) ;
55
55
}
@@ -67,7 +67,7 @@ var client = function(sitekey) {
67
67
this . settings . setSuggestionsPrefix ( prefix ) ;
68
68
69
69
if ( ! this . throttledSuggestionsFetch ) {
70
- this . throttledSuggestionsFetch = throttle ( API_THROTTLE , executeApiFetch ) ;
70
+ this . throttledSuggestionsFetch = throttle ( API_THROTTLE_TIME_MS , executeApiFetch ) ;
71
71
}
72
72
this . throttledSuggestionsFetch ( this . sitekey , 'suggest' , this . settings . getSettings ( ) , callback ) ;
73
73
}
@@ -85,7 +85,7 @@ var client = function(sitekey) {
85
85
this . settings . setAutocompleteParams ( field , prefix ) ;
86
86
87
87
if ( ! this . throttledAutocompleteFetch ) {
88
- this . throttledAutocompleteFetch = throttle ( API_THROTTLE , executeApiFetch ) ;
88
+ this . throttledAutocompleteFetch = throttle ( API_THROTTLE_TIME_MS , executeApiFetch ) ;
89
89
}
90
90
this . throttledAutocompleteFetch ( this . sitekey , 'autocomplete' , this . settings . getSettings ( ) , callback ) ;
91
91
}
@@ -116,7 +116,7 @@ var client = function(sitekey) {
116
116
this . setShuffleAndLimitTo = function ( shuffleAndLimitTo ) { this . settings . setShuffleAndLimitTo ( shuffleAndLimitTo ) ; }
117
117
this . setFuzzyMatch = function ( fuzzy ) { this . settings . setFuzzyMatch ( fuzzy ) ; }
118
118
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 ; }
120
120
this . setStatsSessionId = function ( id ) { this . sessionId = id ; }
121
121
this . getStatsSessionId = function ( ) { return this . sessionId ; }
122
122
0 commit comments