More ko.computed to pureComputed

This commit is contained in:
djmaze 2021-12-31 17:02:32 +01:00
parent a15454fd15
commit 679d7356e0
8 changed files with 46 additions and 50 deletions

View file

@ -34,7 +34,7 @@ export const
target[key] = /*isArray(value) ? ko.observableArray(value) :*/ ko.observable(value) ),
addComputablesTo = (target, computables) =>
forEachObjectEntry(computables, (key, fn) => target[key] = ko.computed(fn)),
forEachObjectEntry(computables, (key, fn) => target[key] = ko.computed(fn, {'pure':true})),
addSubscribablesTo = (target, subscribables) =>
forEachObjectEntry(subscribables, (key, fn) => target[key].subscribe(fn)),