mirror of
https://github.com/koalyptus/TableFilter.git
synced 2024-05-18 14:26:40 +02:00
39 lines
649 B
JavaScript
39 lines
649 B
JavaScript
|
|
const NOTIMPLEMENTED = 'Not implemented.';
|
|
|
|
export class Feature {
|
|
constructor(tf, feature) {
|
|
this.tf = tf;
|
|
this.feature = feature;
|
|
this.enabled = tf[feature];
|
|
this.config = tf.config();
|
|
this.emitter = tf.emitter;
|
|
this.initialized = false;
|
|
}
|
|
|
|
init() {
|
|
throw new Error(NOTIMPLEMENTED);
|
|
}
|
|
|
|
reset() {
|
|
this.enable();
|
|
this.init();
|
|
}
|
|
|
|
destroy() {
|
|
throw new Error(NOTIMPLEMENTED);
|
|
}
|
|
|
|
enable() {
|
|
this.enabled = true;
|
|
}
|
|
|
|
disable() {
|
|
this.enabled = false;
|
|
}
|
|
|
|
isEnabled() {
|
|
return this.enabled;
|
|
}
|
|
}
|