When should I use the Types ComputedRef<> and Ref<> on our Vue js typescript files? #8840
Answered
by
Shyam-Chen
juliano-barros
asked this question in
Help/Questions
-
I was wondering if I should use these types ComputedRef<> and Ref<> in my code when declaring variables, e.g. on pinia store files. what are the advantages and disadvantages of it? Is there any best practice guideline about it? I know these both way work, specifying the type or not, but I didn't find any best practice that could indicate the right direction. |
Beta Was this translation helpful? Give feedback.
Answered by
Shyam-Chen
Jul 27, 2023
Replies: 1 comment 3 replies
-
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You don't need to declare the type explicitly; the type will be inferred automatically.