Trying to use string constant as store name/id #2739
-
Is this possible? export const StoreName = {
StoreOne: 'storeOne',
StoreTwo: 'storeTwo',
StoreThree: 'storeThree'
} as const Then I want to use it like so export default defineStore(StoreName.StoreOne, {
...
...
} But I keep getting errors that StoreName is undefined. My end goal is to keep a map of store name / store state (dirty, etc) so I can better manage my states, and wanted the names to be consistent throughout the app. |
Beta Was this translation helpful? Give feedback.
Answered by
posva
Aug 15, 2024
Replies: 1 comment 1 reply
-
You can but there is no point unless you use check the store's id somewhere. You might be missing the import of |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
posva
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can but there is no point unless you use check the store's id somewhere. You might be missing the import of
StoreName