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

@ -165,7 +165,7 @@
ko.bindingEvent.notify(targetNode, ko.bindingEvent.childrenComplete);
};
if (!options['beforeRemove'] && ko.isObservableArray(arrayOrObservableArray)) {
if (!options['beforeRemove'] && ko['isObservableArray'](arrayOrObservableArray)) {
setDomNodeChildrenFromArrayMapping(arrayOrObservableArray.peek());
var subscription = arrayOrObservableArray['subscribe'](changeList => {
@ -188,7 +188,7 @@
var templateComputedDomDataKey = ko.utils.domData.nextKey();
function disposeOldComputedAndStoreNewOne(element, newComputed) {
var oldComputed = ko.utils.domData.get(element, templateComputedDomDataKey);
oldComputed?.dispose?.();
oldComputed?.['dispose']?.();
ko.utils.domData.set(element, templateComputedDomDataKey, (newComputed && (!newComputed.isActive || newComputed.isActive())) ? newComputed : undefined);
}