mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 05:29:20 +03:00
notifySubscribers and equalityComparer are not used outside KnockoutJS
This commit is contained in:
parent
679d7356e0
commit
30e9b89d9b
9 changed files with 113 additions and 114 deletions
|
|
@ -67,7 +67,7 @@ var ko_subscribable_fn = {
|
|||
return subscription;
|
||||
},
|
||||
|
||||
"notifySubscribers": function (valueToNotify, event) {
|
||||
notifySubscribers: function (valueToNotify, event) {
|
||||
event = event || defaultEvent;
|
||||
if (event === defaultEvent) {
|
||||
this.updateVersion();
|
||||
|
|
@ -105,9 +105,9 @@ var ko_subscribable_fn = {
|
|||
beforeChange = 'beforeChange';
|
||||
|
||||
if (!self._origNotifySubscribers) {
|
||||
self._origNotifySubscribers = self["notifySubscribers"];
|
||||
self._origNotifySubscribers = self.notifySubscribers;
|
||||
// Moved out of "limit" to avoid the extra closure
|
||||
self["notifySubscribers"] = function(value, event) {
|
||||
self.notifySubscribers = function(value, event) {
|
||||
if (!event || event === defaultEvent) {
|
||||
this._limitChange(value);
|
||||
} else if (event === 'beforeChange') {
|
||||
|
|
@ -165,7 +165,7 @@ var ko_subscribable_fn = {
|
|||
},
|
||||
|
||||
isDifferent: function(oldValue, newValue) {
|
||||
return !this['equalityComparer'] || !this['equalityComparer'](oldValue, newValue);
|
||||
return !this.equalityComparer || !this.equalityComparer(oldValue, newValue);
|
||||
},
|
||||
|
||||
toString: () => '[object Object]',
|
||||
|
|
@ -197,4 +197,4 @@ ko.subscribable['fn'] = ko_subscribable_fn;
|
|||
|
||||
|
||||
ko.isSubscribable = instance =>
|
||||
instance != null && typeof instance.subscribe == "function" && typeof instance["notifySubscribers"] == "function";
|
||||
instance != null && typeof instance.subscribe == "function" && typeof instance.notifySubscribers == "function";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue