Remove unused data from KnockoutJS

This commit is contained in:
djmaze 2021-09-28 14:03:07 +02:00
parent 5cb4d338a1
commit bf756c9279
6 changed files with 6 additions and 39 deletions

View file

@ -17,17 +17,6 @@ ko.bindingHandlers['textInput'] = {
}
};
var deferUpdateModel = event => {
if (!timeoutHandle) {
// The elementValueBeforeEvent variable is set *only* during the brief gap between an
// event firing and the updateModel function running. This allows us to ignore model
// updates that are from the previous state of the element, usually due to techniques
// such as rateLimit. Such updates, if not ignored, can cause keystrokes to be lost.
elementValueBeforeEvent = element.value;
timeoutHandle = setTimeout(updateModel, 4);
}
};
var updateView = () => {
var modelValue = ko.utils.unwrapObservable(valueAccessor());