Skip to content

Commit 51e67e0

Browse files
natemoo-reastrobot-houston
authored andcommitted
[ci] format
1 parent 1f58a7a commit 51e67e0

File tree

5 files changed

+19
-13
lines changed

5 files changed

+19
-13
lines changed

packages/astro/src/runtime/server/astro-island.ts

+8-4
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,14 @@ declare const Astro: {
5252
public hydrator: any;
5353
static observedAttributes = ['props'];
5454
disconnectedCallback() {
55-
document.addEventListener('astro:after-swap', () => {
56-
// If element wasn't persisted, fire unmount event
57-
if (!this.isConnected) this.dispatchEvent(new CustomEvent('astro:unmount'))
58-
}, { once: true })
55+
document.addEventListener(
56+
'astro:after-swap',
57+
() => {
58+
// If element wasn't persisted, fire unmount event
59+
if (!this.isConnected) this.dispatchEvent(new CustomEvent('astro:unmount'));
60+
},
61+
{ once: true }
62+
);
5963
}
6064
connectedCallback() {
6165
if (!this.hasAttribute('await-children') || this.firstChild) {

packages/integrations/preact/src/client.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { SignalLike } from './types';
2-
import { h, render, hydrate } from 'preact';
1+
import { h, hydrate, render } from 'preact';
32
import StaticHtml from './static-html.js';
3+
import type { SignalLike } from './types';
44

55
const sharedSignalMap = new Map<string, SignalLike>();
66

@@ -32,9 +32,9 @@ export default (element: HTMLElement) =>
3232

3333
bootstrap(
3434
h(Component, props, children != null ? h(StaticHtml, { value: children }) : children),
35-
element,
35+
element
3636
);
37-
37+
3838
// Preact has no "unmount" option, but you can use `render(null, element)`
39-
element.addEventListener('astro:unmount', () => render(null, element), { once: true })
39+
element.addEventListener('astro:unmount', () => render(null, element), { once: true });
4040
};

packages/integrations/react/client-v17.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,7 @@ export default (element) =>
1616
const isHydrate = client !== 'only';
1717
const bootstrap = isHydrate ? hydrate : render;
1818
bootstrap(componentEl, element);
19-
element.addEventListener('astro:unmount', () => unmountComponentAtNode(element), { once: true });
19+
element.addEventListener('astro:unmount', () => unmountComponentAtNode(element), {
20+
once: true,
21+
});
2022
};

packages/integrations/solid/src/client.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,5 +43,5 @@ export default (element: HTMLElement) =>
4343
}
4444
);
4545

46-
element.addEventListener('astro:unmount', () => dispose(), { once: true })
46+
element.addEventListener('astro:unmount', () => dispose(), { once: true });
4747
};

packages/integrations/svelte/client.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ export default (target) => {
2424
hydrate: client !== 'only',
2525
$$inline: true,
2626
});
27-
28-
element.addEventListener('astro:unmount', () => component.$destroy(), { once: true })
27+
28+
element.addEventListener('astro:unmount', () => component.$destroy(), { once: true });
2929
} catch (e) {
3030
} finally {
3131
if (import.meta.env.DEV) finishUsingConsoleFilter();

0 commit comments

Comments
 (0)