Skip to content

Commit

Permalink
fix(vue3): remove console logging (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
bourdaisj authored Jan 5, 2024
1 parent 7e2df78 commit d7cb238
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 50 deletions.
16 changes: 2 additions & 14 deletions vue3-components/src/components/Simput/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ export default {
setup(props, { emit }) {
const trame = inject("trame");

console.log({
trame,
props,
});

const manager = ref(null);
const managerId = ref(null);

Expand All @@ -54,25 +49,18 @@ export default {
manager.value.disconnectBus(simputChannel);
}

console.log("Simput - updateManager");

managerId.value = trame.state.get(`${props.namespace}Id`);
console.log({
managerId: managerId.value,
});

manager.value = getSimputManager(
managerId.value,
props.namespace,
client.value
);
console.log({
manager: manager.value,
});

manager.value.connectBus(simputChannel);
};

onMounted(() => {
console.log("Simput - onMounted");
updateManager();
});

Expand Down
33 changes: 0 additions & 33 deletions vue3-components/src/components/SimputItem/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,28 +36,14 @@ export default {

const update = function update() {
if (proxyId.value && getSimput()) {
console.log("SimputItem - update");
console.log({
proxyId: proxyId.value,
});
data.value = getSimput().getData(proxyId.value);
domains.value = getSimput().getDomains(proxyId.value);

console.log({
data: data.value,
domains: domains.value,
computedType: computedType.value,
});

if (computedType.value) {
ui.value = getSimput().getUI(computedType.value);
console.log({
ui: ui.value,
});
}
simputChannel.pushQuery();
} else {
console.log("SimputItem - update: reset data and ui")
data.value = null;
ui.value = null;
}
Expand All @@ -70,53 +56,34 @@ export default {
const onChange = function onChange({ id, type }) {
/* eslint-disable eqeqeq */
if (id && proxyId.value == id) {
console.log("SimputItem - onChange");
data.value = getSimput().getData(id);
domains.value = getSimput().getDomains(id);
console.log({
data: data.value,
domains: domains.value,
});
}
if (type && computedType.value === type) {
ui.value = getSimput().getUI(computedType.value);
}
if (!type && computedType.value && !ui.value) {
ui.value = getSimput().getUI(computedType.value);
}
console.log({
ui: ui.value,
});
};

const onReload = function onReload(name) {
console.log("SimputItem - onReload");
if (name === "data") {
data.value = getSimput().getData(proxyId.value, true);
console.log({
data: data.value,
});
}
if (name === "ui") {
ui.value = getSimput().getUI(proxyId.value, true);
console.log({
ui: ui.value,
});
}
if (name === "domain") {
getSimput().resetDomains();
domains.value = getSimput().getDomains(proxyId.value, true);
console.log({
domains: domains.value,
});
}
};

onMounted(() => {
simputChannel.$on("connect", onConnect);
simputChannel.$on("change", onChange);
simputChannel.$on("reload", onReload);
console.log("SimputItem - onMounted");
update();
});

Expand Down
5 changes: 2 additions & 3 deletions vue3-components/src/core/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,13 +299,12 @@ export class DataManager {
if ((!data || forceFetch) && !this.pendingData[id]) {
// console.log(' > fetch data', id, forceFetch);
this.pendingData[id] = true;
console.log("utils.js - triggering SimputFetch");

this.wsClient
.getRemote()
.Trame.trigger(`${this.namespace}Fetch`, [], { id });
}
console.log("utils.js - return");
console.log({ data });

return data;
}

Expand Down

0 comments on commit d7cb238

Please sign in to comment.