,debouncedAjax: _.debounce(_.bind(myFunction, this), 2000)
,request: function(requestParams, response){
this.debouncedAjax(requestParams, response);
}
私が要求できるとき、私はこれを手に入れます
Uncaught TypeError: undefined (無名関数) のメソッド 'apply' を呼び出せません
このようにdebouncedAjaxプロパティにそのデバウンス関数の結果を設定すると
,initialize: function() {
this.debouncedAjax = _.debounce(this.imoveisAjaxRequest, 2000);
}
それは正常に動作します!
なぜ ?
ところで: debounce は AMAZING underscore.js フレームワークの関数です!