mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-05 23:47:03 +03:00
replaced ko.utils.array* with native
This commit is contained in:
parent
20b1e08c9b
commit
d49916731f
14 changed files with 137 additions and 230 deletions
|
|
@ -160,10 +160,10 @@ var computedFn = {
|
|||
return false;
|
||||
}
|
||||
var dependencies = this.getDependencies();
|
||||
if (ko.utils.arrayIndexOf(dependencies, obs) !== -1) {
|
||||
if (dependencies.includes(obs)) {
|
||||
return true;
|
||||
}
|
||||
return !!ko.utils.arrayFirst(dependencies, dep =>
|
||||
return !!dependencies.find(dep =>
|
||||
dep.hasAncestorDependency && dep.hasAncestorDependency(obs)
|
||||
);
|
||||
},
|
||||
|
|
@ -425,7 +425,7 @@ var pureComputedOverrides = {
|
|||
dependenciesOrder[dependency._order] = id
|
||||
);
|
||||
// Next, subscribe to each one
|
||||
ko.utils.arrayForEach(dependenciesOrder, (id, order) => {
|
||||
dependenciesOrder.forEach((id, order) => {
|
||||
var dependency = state.dependencyTracking[id],
|
||||
subscription = computedObservable.subscribeToDependency(dependency._target);
|
||||
subscription._order = order;
|
||||
|
|
|
|||
|
|
@ -47,13 +47,11 @@ ko.observableArray['fn'] = {
|
|||
// If you passed an arg, we interpret it as an array of entries to remove
|
||||
if (!arrayOfValues)
|
||||
return [];
|
||||
return this['remove'](function (value) {
|
||||
return ko.utils.arrayIndexOf(arrayOfValues, value) >= 0;
|
||||
});
|
||||
return this['remove'](value => arrayOfValues.includes(value));
|
||||
},
|
||||
|
||||
'indexOf': function (item) {
|
||||
return ko.utils.arrayIndexOf(this(), item);
|
||||
return this().indexOf(item);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue