KnockoutJS drop unused rateLimit method

This commit is contained in:
the-djmaze 2024-01-09 14:52:05 +01:00
parent 6b3c073ddd
commit 2a3cea63cc
3 changed files with 13 additions and 37 deletions

View file

@ -1,19 +1,7 @@
ko.extenders = {
'debounce': (target, timeout) => target.limit(callback => debounce(callback, timeout)),
'rateLimit': (target, options) => {
var timeout, method, limitFunction;
if (typeof options == 'number') {
timeout = options;
} else {
timeout = options['timeout'];
method = options['method'];
}
limitFunction = typeof method == 'function' ? method : throttle;
target.limit(callback => limitFunction(callback, timeout, options));
},
'rateLimit': (target, timeout) => target.limit(callback => throttle(callback, timeout)),
'notify': (target, notifyWhen) => {
target.equalityComparer = notifyWhen == "always" ?