(options: Partial<BethPluginOptions> = {})
| 8 | type BethPluginOptions = GlobalCacheConfig; |
| 9 | |
| 10 | export function bethStack(options: Partial<BethPluginOptions> = {}) { |
| 11 | // setGlobalPersistCacheConfig(options); |
| 12 | |
| 13 | async function html<T extends () => JSX.Element>( |
| 14 | lazyHtml: T, |
| 15 | ): Promise<Response> { |
| 16 | return renderToStringResponse(lazyHtml); |
| 17 | } |
| 18 | |
| 19 | function htmlStream<T extends () => JSX.Element>(lazyHtml: T): Response { |
| 20 | return renderToStreamResponse(lazyHtml); |
| 21 | } |
| 22 | |
| 23 | return function bethPlugin(app: Elysia) { |
| 24 | return app.decorate("html", html).decorate("htmlStream", htmlStream); |
| 25 | // ! FIX WHEN ELYSIA IS FIXED |
| 26 | // .onRequest(() => { |
| 27 | // BETH_GLOBAL_RENDER_CACHE.reset(); |
| 28 | // // elysia is weird idk |
| 29 | // return void 0; |
| 30 | // }) |
| 31 | // .onResponse(() => { |
| 32 | // BETH_GLOBAL_RENDER_CACHE.reset(); |
| 33 | // // elysia is weird idk |
| 34 | // return void 0; |
| 35 | // }); |
| 36 | }; |
| 37 | } |
nothing calls this directly
no outgoing calls
no test coverage detected