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

FactoryInterface type with traits #245

Open
subvertallchris opened this issue Dec 28, 2023 · 1 comment
Open

FactoryInterface type with traits #245

subvertallchris opened this issue Dec 28, 2023 · 1 comment
Labels
question Further information is requested

Comments

@subvertallchris
Copy link

Hello again! Can you share some advice on using the XyzFactoryInterface so that it has an awareness of traits? The type takes a generic, TOptions, but it looks like it wants something elaborate and I can't pin it down and don't see examples in the tests.

Thank you!

@Quramy
Copy link
Owner

Quramy commented Dec 29, 2023

XyzFactoryInterface is used to avoid TS circular reference error.

https://github.com/Quramy/prisma-fabbrica?tab=readme-ov-file#suppress-ts-circular-dependencies-error

And the type parameter TOptions is defined to infer concrete traits keys from argument defineXyzFactory .

@Quramy Quramy added the question Further information is requested label Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants