Replaced dev/Common/ClientStorageDriver/* with webstorage polyfill

Cleanup some other code
This commit is contained in:
djmaze 2020-09-03 12:51:15 +02:00
parent 0e8bf13d5d
commit b837013cfb
13 changed files with 201 additions and 594 deletions

View file

@ -41,14 +41,14 @@ export function hideLoading() {
*/
export function createCommand(fExecute, fCanExecute = true) {
let fResult = null;
const fNonEmpty = (...args) => {
if (fResult && fResult.canExecute && fResult.canExecute()) {
fExecute.apply(null, args);
}
return false;
};
fResult = fExecute ? fNonEmpty : ()=>{};
fResult = fExecute
? (...args) => {
if (fResult && fResult.canExecute && fResult.canExecute()) {
fExecute.apply(null, args);
}
return false;
} : ()=>{};
fResult.enabled = ko.observable(true);
fResult.isCommand = true;