Improved observables

This commit is contained in:
djmaze 2020-10-27 11:09:24 +01:00
parent 8d7e25fc7c
commit 7db7d5545b
28 changed files with 236 additions and 234 deletions

View file

@ -287,15 +287,4 @@ ko.extenders.specialThrottle = (target, timeout) => {
return target;
};
// functions
ko.observable.fn.validateEmail = function() {
this.hasError = ko.observable(false);
this.subscribe(value => this.hasError(value && !/^[^@\s]+@[^@\s]+$/.test(value)));
this.valueHasMutated();
return this;
};
export default ko;