How to declare returning type when calling defineStore #2518
-
Is it a proper way to declare returning type when calling defineStore? |
Beta Was this translation helpful? Give feedback.
Answered by
posva
Dec 14, 2023
Replies: 1 comment 2 replies
-
You don't, let Pinia infer the types for you. The only place you should put the types is at the level of the different properties: defineStore('id', () => {
const count = ref<number>(0) // <-- here
return { count }
}) |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
posva
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You don't, let Pinia infer the types for you. The only place you should put the types is at the level of the different properties: