JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://github.com/downloads/SteveSanderson/knockout/knockout-2.0.0.js"></script>
<input type="text" data-bind="value: textValue, valueUpdate: 'afterkeyup'" />
JavaScript
function ViewModel(){
var self = this;
self.textValue = ko.observable();
self.throttledValue = ko.computed(this.textValue).extend({ throttle: 400 });
self.throttledValue.subscribe(function (val) {
if (val !== ''){
$.ajax({
url: 'http://fiddle.jshell.net/favicon.png',
success : function(html){
console.log('response handled');
console.log(html);
debugger;
}
});
}
});
};
ko.applyBindings(new ViewModel());