Only apply typings for state if a store has specific custom option set? #2065
Unanswered
richardvanbergen
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.
-
In the documentation for plugins it says you can apply custom options conditionally.
It also says you can augment state and actions on a per-store basis. However, the Typescript augmentations seem to affect the pinia instance globally and as far as I can tell there's no mechanism to say "if the store extends this custom option, apply these state properties".
This means that if you define a store and don't apply the option typescript will think the state exists, even when it doesn't.
Am I doing something wrong or is this something that's not possible/unsupported?
Beta Was this translation helpful? Give feedback.
All reactions