Getters Approach #863
Closed
bencodezen
started this conversation in
Ideas
Replies: 1 comment 5 replies
-
The last pattern is the only one that doesn't work because it's not technically possible (or didn't find a way) in TS to infer the getters, maybe it is possible in a way by excluding the current one. I personally prefer recommending the arrow function one when possible because you don't need to type the return but you cannot use other getters while the regular function one, which is way more verbose, requires you to type the return value but can use other getters |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm reading over the docs for getters in Pinia and did some testing to figure out that there are two patterns people can use:
this
context through non-arrow functionsIf I'm not mistaken, all of these patterns are valid:
I'd like to update the docs to reflect these patterns if possible, but wanted to see if there were any pros or cons between the two that I should know about.
Beta Was this translation helpful? Give feedback.
All reactions