Cleanup component models

This commit is contained in:
the-djmaze 2022-02-16 23:12:12 +01:00
parent 536a9d20fd
commit 5748dea4bc
6 changed files with 71 additions and 105 deletions

View file

@ -1,13 +1,10 @@
import ko from 'ko';
import { AbstractComponent } from 'Component/Abstract';
class AbstractCheckbox extends AbstractComponent {
export class AbstractCheckbox {
/**
* @param {Object} params = {}
*/
constructor(params = {}) {
super();
this.value = ko.isObservable(params.value) ? params.value
: ko.observable(!!params.value);
@ -24,5 +21,3 @@ class AbstractCheckbox extends AbstractComponent {
this.enable() && this.value(!this.value());
}
}
export { AbstractCheckbox };