mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-10-31 09:33:33 +03:00
Use JavaScript Optional chaining in vendors/*
This commit is contained in:
parent
e5e4675c1b
commit
ef8b1f40e4
28 changed files with 619 additions and 750 deletions
10
vendors/knockout/src/subscribables/observable.js
vendored
10
vendors/knockout/src/subscribables/observable.js
vendored
|
|
@ -14,11 +14,9 @@ ko.observable = initialValue => {
|
|||
}
|
||||
return this; // Permits chained assignments
|
||||
}
|
||||
else {
|
||||
// Read
|
||||
ko.dependencyDetection.registerDependency(observable); // The caller only needs to be notified of changes if they did a "read" operation
|
||||
return observable[observableLatestValue];
|
||||
}
|
||||
// Read
|
||||
ko.dependencyDetection.registerDependency(observable); // The caller only needs to be notified of changes if they did a "read" operation
|
||||
return observable[observableLatestValue];
|
||||
}
|
||||
|
||||
observable[observableLatestValue] = initialValue;
|
||||
|
|
@ -40,7 +38,7 @@ ko.observable = initialValue => {
|
|||
var observableFn = {
|
||||
'toJSON': function() {
|
||||
let value = this[observableLatestValue];
|
||||
return value && value.toJSON ? value.toJSON() : value;
|
||||
return value?.toJSON?.() || value;
|
||||
},
|
||||
equalityComparer: valuesArePrimitiveAndEqual,
|
||||
peek: function() { return this[observableLatestValue]; },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue