Skip to content

Commit

Permalink
'changes' => 'watchers', 'retreives' => 'loads'
Browse files Browse the repository at this point in the history
  • Loading branch information
V13Axel committed Nov 12, 2024
1 parent 178a2f9 commit 7c96b15
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
6 changes: 3 additions & 3 deletions resources/js/calendar/clock_collapsible.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import CollapsibleComponent from "./collapsible_component";

class ClockCollapsible extends CollapsibleComponent {
key = 'clock';
retrieves = {
loads = {
'clock': 'clock'
};
changes = {

watchers = {
'clock': this.changed
};

Expand Down
10 changes: 3 additions & 7 deletions resources/js/calendar/collapsible_component.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default class CollapsibleComponent {
initialized = false;
retrieves = {};
changes = {};
watchers = {};

load(static_data) {
if (!static_data) {
Expand All @@ -15,8 +15,8 @@ export default class CollapsibleComponent {
this.calendar_settings = static_data.settings;

if (!this.initialized) {
for (let localKey of Object.keys(this.changes)) {
this.$watch(localKey, this.changes[localKey].bind(this));
for (let localKey of Object.keys(this.watchers)) {
this.$watch(localKey, this.watchers[localKey].bind(this));
}

this.initialized = true;
Expand All @@ -28,8 +28,4 @@ export default class CollapsibleComponent {
loaded(static_data) {
// throw new Error(`The component ${this.prototype.constructor.name} must implement 'changed()'!`);
}

changed() {
// throw new Error(`The component ${this.prototype.constructor.name} must implement 'changed()'!`);
}
}

0 comments on commit 7c96b15

Please sign in to comment.