Lost types when using factory pattern #1922
Unanswered
leo-coco
asked this question in
Help and Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, for the need of my project I need to create a storeFactory to modulate the creation of a pinia store. I specifically removed the parameters here and simplified the code example.
When I'm in File A, the type of
storeFactory
is automatically retrieved correctlyWhen I'm file B the type is lost and only this can be inferred
StoreDefinition<"store_id", {} | _UnwrapAll<Pick<any, string | number>>, {} | Pick<...>, {} | Pick<...>
File A
File B
Is there a solution for my issue? How can we preserve the automatic type while wrapping the define store in a factory method?
Beta Was this translation helpful? Give feedback.
All reactions