[ci] format

This commit is contained in:
natemoo-re 2022-05-31 16:47:13 +00:00 committed by github-actions[bot]
parent c9d8b10a85
commit e02c72f445
8 changed files with 61 additions and 59 deletions

View file

@ -94,4 +94,3 @@ test.describe('Nested Frameworks in Solid', () => {
await expect(count, 'count incremented by 1').toHaveText('1');
});
});

View file

@ -14,7 +14,8 @@ export const notify = debounce(() => {
}
});
export const listen = (cb: (...args: any[]) => any) => window.addEventListener(HYDRATE_KEY, cb, { once: true });
export const listen = (cb: (...args: any[]) => any) =>
window.addEventListener(HYDRATE_KEY, cb, { once: true });
if (!(window as any)[HYDRATE_KEY]) {
if ('MutationObserver' in window) {

View file

@ -14,7 +14,7 @@ export default async function onIdle(
let hydrate: Awaited<ReturnType<GetHydrateCallback>>;
async function idle() {
listen(idle)
listen(idle);
const cb = async () => {
const roots = document.querySelectorAll(`astro-root[ssr][uid="${astroId}"]`);
if (roots.length === 0) return;

View file

@ -13,7 +13,7 @@ export default async function onMedia(
let hydrate: Awaited<ReturnType<GetHydrateCallback>>;
async function media() {
listen(media)
listen(media);
const cb = async () => {
const roots = document.querySelectorAll(`astro-root[ssr][uid="${astroId}"]`);
if (roots.length === 0) return;

View file

@ -16,7 +16,7 @@ export default async function onVisible(
let hydrate: Awaited<ReturnType<GetHydrateCallback>>;
async function visible() {
listen(visible)
listen(visible);
const roots = document.querySelectorAll(`astro-root[ssr][uid="${astroId}"]`);
const cb = async () => {
if (roots.length === 0) return;

View file

@ -7,4 +7,4 @@ export default (element) => (Component, props, children) => {
h(Component, props, children != null ? h(StaticHtml, { value: children }) : children),
element
);
}
};

View file

@ -1,7 +1,8 @@
import { sharedConfig } from 'solid-js';
import { hydrate, render, createComponent } from 'solid-js/web';
export default (element) => (Component, props, childHTML, { client }) => {
export default (element) =>
(Component, props, childHTML, { client }) => {
// Prepare global object expected by Solid's hydration logic
if (!window._$HY) {
window._$HY = { events: [], completed: new WeakSet(), r: {} };

View file

@ -1,7 +1,8 @@
import { h, createSSRApp, createApp } from 'vue';
import StaticHtml from './static-html.js';
export default (element) => (Component, props, children, { client }) => {
export default (element) =>
(Component, props, children, { client }) => {
delete props['class'];
if (!element.hasAttribute('ssr')) return;