download
raw
726 Bytes
// src/jsx/dom/components.ts
import { DOM_ERROR_HANDLER } from "../constants.js";
import { Fragment } from "./jsx-runtime.js";
var ErrorBoundary = (({ children, fallback, fallbackRender, onError }) => {
const res = Fragment({ children });
res[DOM_ERROR_HANDLER] = (err) => {
if (err instanceof Promise) {
throw err;
}
onError?.(err);
return fallbackRender?.(err) || fallback;
};
return res;
});
var Suspense = (({
children,
fallback
}) => {
const res = Fragment({ children });
res[DOM_ERROR_HANDLER] = (err, retry) => {
if (!(err instanceof Promise)) {
throw err;
}
err.finally(retry);
return fallback;
};
return res;
});
export {
ErrorBoundary,
Suspense
};

Xet Storage Details

Size:
726 Bytes
·
Xet hash:
1e02da0b477466d135f30b27ed28877c34151cdc0d07080ddf54b834515c59ff

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.