Skip to content

Commit

Permalink
Merge pull request #54 from pmenta/feat/next-improvement
Browse files Browse the repository at this point in the history
feat: add cache option to renderTrpcPanel
  • Loading branch information
iway1 authored Apr 4, 2023
2 parents 7b6ff1e + 52dc2eb commit 72710d7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/trpc-panel/src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {

export type RenderOptions = {
url: string;
cache?: boolean;
} & TrpcPanelExtraOptions;

const defaultParseRouterOptions: Partial<TrpcPanelExtraOptions> = {
Expand Down Expand Up @@ -62,7 +63,8 @@ let cache: {
};

export function renderTrpcPanel(router: Router<any>, options: RenderOptions) {
if (cache.val) return cache.val;
if (options.cache !== false && cache.val) return cache.val;

const bundleInjectionParams: InjectionParam[] = [
{
searchFor: routerReplaceSymbol,
Expand Down

0 comments on commit 72710d7

Please sign in to comment.