Skip to content

Commit

Permalink
enhancement: nextjs update globalThis type declaration (#5610)
Browse files Browse the repository at this point in the history
update `globalThis` include prisma only for db file

Co-authored-by: Jon Harrell <[email protected]>
  • Loading branch information
decovicdev and jharrell authored May 2, 2024
1 parent af23406 commit 1e4a8b5
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ const prismaClientSingleton = () => {
return new PrismaClient()
}

declare global {
var prismaGlobal: undefined | ReturnType<typeof prismaClientSingleton>
}
declare const globalThis: {
prisma: ReturnType<typeof prismaClientSingleton>;
} & typeof global;

const prisma = globalThis.prismaGlobal ?? prismaClientSingleton()

Expand Down

0 comments on commit 1e4a8b5

Please sign in to comment.