Initial commit
This commit is contained in:
commit
b3a51a4115
10336 changed files with 2381973 additions and 0 deletions
32
node_modules/hono/dist/jsx/dom/components.js
generated
vendored
Normal file
32
node_modules/hono/dist/jsx/dom/components.js
generated
vendored
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
// 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
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue