Skip to content

Commit 224a9bc

Browse files
♻️ Remove some console logs.
1 parent 9fded0a commit 224a9bc

File tree

1 file changed

+37
-36
lines changed

1 file changed

+37
-36
lines changed

src/lustre.ffi.mjs

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,13 @@ export class LustreClientApplication {
105105
const vdom = this.#view(this.#model);
106106
const dispatch =
107107
(handler, immediate = false) =>
108-
(event) => {
109-
const result = handler(event);
108+
(event) => {
109+
const result = handler(event);
110110

111-
if (result instanceof Ok) {
112-
this.send(new Dispatch(result[0], immediate));
113-
}
114-
};
111+
if (result instanceof Ok) {
112+
this.send(new Dispatch(result[0], immediate));
113+
}
114+
};
115115
const prev =
116116
this.root.firstChild ??
117117
this.root.appendChild(document.createTextNode(""));
@@ -192,13 +192,13 @@ export class LustreClientApplication {
192192
const vdom = this.#view(this.#model);
193193
const dispatch =
194194
(handler, immediate = false) =>
195-
(event) => {
196-
const result = handler(event);
195+
(event) => {
196+
const result = handler(event);
197197

198-
if (result instanceof Ok) {
199-
this.send(new Dispatch(result[0], immediate));
200-
}
201-
};
198+
if (result instanceof Ok) {
199+
this.send(new Dispatch(result[0], immediate));
200+
}
201+
};
202202
const prev =
203203
this.root.firstChild ??
204204
this.root.appendChild(document.createTextNode(""));
@@ -228,7 +228,7 @@ export class LustreClientApplication {
228228
composed: true,
229229
}),
230230
);
231-
const select = () => { };
231+
const select = () => {};
232232

233233
effect({ dispatch, emit, select });
234234
}
@@ -380,16 +380,16 @@ export const make_lustre_client_component = (
380380
const vdom = view(this.#model);
381381
const dispatch =
382382
(handler, immediate = false) =>
383-
(event) => {
384-
const result = handler(event);
385-
386-
if (result instanceof Ok) {
387-
this.send(new Dispatch(result[0], immediate));
388-
}
389-
};
390-
const prev = this.shadowRoot.childNodes[this.#adoptedStyleElements.length] ??
391-
this.shadowRoot.appendChild(document.createTextNode(""));
383+
(event) => {
384+
const result = handler(event);
392385

386+
if (result instanceof Ok) {
387+
this.send(new Dispatch(result[0], immediate));
388+
}
389+
};
390+
const prev =
391+
this.shadowRoot.childNodes[this.#adoptedStyleElements.length] ??
392+
this.shadowRoot.appendChild(document.createTextNode(""));
393393

394394
morph(prev, vdom, dispatch);
395395
}
@@ -457,19 +457,17 @@ export const make_lustre_client_component = (
457457
const vdom = view(this.#model);
458458
const dispatch =
459459
(handler, immediate = false) =>
460-
(event) => {
461-
const result = handler(event);
460+
(event) => {
461+
const result = handler(event);
462462

463-
if (result instanceof Ok) {
464-
this.send(new Dispatch(result[0], immediate));
465-
}
466-
};
467-
const prev = this.shadowRoot.childNodes[this.#adoptedStyleElements.length] ??
463+
if (result instanceof Ok) {
464+
this.send(new Dispatch(result[0], immediate));
465+
}
466+
};
467+
const prev =
468+
this.shadowRoot.childNodes[this.#adoptedStyleElements.length] ??
468469
this.shadowRoot.appendChild(document.createTextNode(""));
469470

470-
471-
console.log({ prev })
472-
473471
morph(prev, vdom, dispatch);
474472
}
475473

@@ -495,7 +493,7 @@ export const make_lustre_client_component = (
495493
composed: true,
496494
}),
497495
);
498-
const select = () => { };
496+
const select = () => {};
499497

500498
effect({ dispatch, emit, select });
501499
}
@@ -512,7 +510,7 @@ export const make_lustre_client_component = (
512510
async #adoptStyleSheets() {
513511
const pendingParentStylesheets = [];
514512
for (const link of document.querySelectorAll("link[rel=stylesheet]")) {
515-
if (link.sheet) continue
513+
if (link.sheet) continue;
516514

517515
pendingParentStylesheets.push(
518516
new Promise((resolve, reject) => {
@@ -541,7 +539,10 @@ export const make_lustre_client_component = (
541539
try {
542540
const adoptedSheet = new CSSStyleSheet();
543541
for (const rule of sheet.cssRules) {
544-
adoptedSheet.insertRule(rule.cssText, adoptedSheet.cssRules.length);
542+
adoptedSheet.insertRule(
543+
rule.cssText,
544+
adoptedSheet.cssRules.length,
545+
);
545546
}
546547

547548
this.shadowRoot.adoptedStyleSheets.push(adoptedSheet);
@@ -691,7 +692,7 @@ export class LustreServerApplication {
691692
composed: true,
692693
}),
693694
);
694-
const select = () => { };
695+
const select = () => {};
695696

696697
effect({ dispatch, emit, select });
697698
}

0 commit comments

Comments
 (0)