Replace some ko.exportSymbol('*') in favour of ko['*']

and drop ko.exportProperty()
This commit is contained in:
the-djmaze 2024-02-11 15:37:24 +01:00
parent 6c144b5a28
commit 7c1f70c51e
16 changed files with 145 additions and 173 deletions

View file

@ -1,5 +1,5 @@
const arrayChangeEventName = 'arrayChange';
ko.extenders['trackArrayChanges'] = (target, options) => {
ko['extenders']['trackArrayChanges'] = (target, options) => {
// Use the provided options--each call to trackArrayChanges overwrites the previously set options
target.compareArrayOptions = {};
if (typeof options == "object") {
@ -31,8 +31,8 @@ ko.extenders['trackArrayChanges'] = (target, options) => {
target.afterSubscriptionRemove = event => {
underlyingAfterSubscriptionRemoveFunction?.call(target, event);
if (event === arrayChangeEventName && !target.hasSubscriptionsForEvent(arrayChangeEventName)) {
changeSubscription?.dispose();
spectateSubscription?.dispose();
changeSubscription?.['dispose']();
spectateSubscription?.['dispose']();
spectateSubscription = changeSubscription = null;
trackingChanges = false;
previousContents = undefined;