mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 12:09:20 +03:00
Move addObservablesTo, addComputablesTo & addSubscribablesTo to Common/Utils
This commit is contained in:
parent
eda0ee695d
commit
4b6f6b1bfc
18 changed files with 55 additions and 46 deletions
11
dev/External/ko.js
vendored
11
dev/External/ko.js
vendored
|
|
@ -197,14 +197,3 @@ ko.extenders.falseTimeout = (target, option) => {
|
|||
ko.observable.fn.deleteAccessHelper = function() {
|
||||
return this.extend({ falseTimeout: 3000, toggleSubscribeProperty: [this, 'deleteAccess'] });
|
||||
};
|
||||
|
||||
ko.addObservablesTo = (target, observables) => {
|
||||
Object.entries(observables).forEach(([key, value]) =>
|
||||
target[key] = /*Array.isArray(value) ? ko.observableArray(value) :*/ ko.observable(value) );
|
||||
};
|
||||
|
||||
ko.addComputablesTo = (target, computables) =>
|
||||
Object.entries(computables).forEach(([key, fn]) => target[key] = ko.computed(fn));
|
||||
|
||||
ko.addSubscribablesTo = (target, subscribables) =>
|
||||
Object.entries(subscribables).forEach(([key, fn]) => target[key].subscribe(fn));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue