Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(client): type inference for prismaClient.$on(...) #24133

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

nikelborm
Copy link

@nikelborm nikelborm commented May 8, 2024

Problem

incorrect inference in generic that returned never instead of T led to error

Solution

I fixed the generic and also made type recursive so it doesn't depend on length of log array.
Might fix following issues #19463 #11986 notiz-dev/nestjs-prisma#56

Before

Screenshot from 2024-03-05 14-23-28

After

Screenshot from 2024-03-05 14-37-44
Screenshot from 2024-03-05 14-41-01

@nikelborm nikelborm requested a review from a team as a code owner May 8, 2024 22:59
@nikelborm nikelborm requested review from jkomyno and removed request for a team May 8, 2024 22:59
Copy link

codspeed-hq bot commented May 8, 2024

CodSpeed Performance Report

Merging #24133 will not alter performance

Comparing nikelborm:main (55e148f) with main (e0006b1)

Summary

✅ 3 untouched benchmarks

@janpio janpio changed the title fix(client): type inference for prismaClient.$on(...) fix(client): type inference for prismaClient.$on(...) May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant