From 52dc2ebbe29be99d587c5a82d4f997ba34a883aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Martins?= Date: Mon, 3 Apr 2023 04:57:13 -0300 Subject: [PATCH] feat: add cache option to renderTrpcPanel --- packages/trpc-panel/src/render.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/trpc-panel/src/render.ts b/packages/trpc-panel/src/render.ts index 59746a5..8c3c6de 100644 --- a/packages/trpc-panel/src/render.ts +++ b/packages/trpc-panel/src/render.ts @@ -9,6 +9,7 @@ import { export type RenderOptions = { url: string; + cache?: boolean; } & TrpcPanelExtraOptions; const defaultParseRouterOptions: Partial = { @@ -62,7 +63,8 @@ let cache: { }; export function renderTrpcPanel(router: Router, options: RenderOptions) { - if (cache.val) return cache.val; + if (options.cache !== false && cache.val) return cache.val; + const bundleInjectionParams: InjectionParam[] = [ { searchFor: routerReplaceSymbol,