Open nicolidin opened 3 years ago
Furthermore provide
is not accessible through this.$provide
and only accessible through the @Options
decorator, it would be firstly interesting to allow access to provide and inject through this.$
. in a type-safety way.
Moreover, Provide and Inject don't have any type-safety checking and act as they have an any
type.
(It might need another issue)
This issue references the answer you @ktsn wrote about the usage of
watch
andprovide/inject
in a safe way:ktsn :" You can access
this
via both@Options
andthis.$watch
already. As for provide/inject, I'm considering an API to achieve it in type safe way currently. Also, you can still use vue-property-decorator if you prefer it since the author said he is going to update it for Vue 3.Originally posted by @ktsn in https://github.com/vuejs/vue-class-component/issues/468#issuecomment-706149254 "
Indeed, it could be more safe , readable and typescript way to use for the
this.$watch
parameter directly the symbol of the property to watch instead of the string corresponding to the symbol we want to watch.So for example, instead of the above
"count"
string, it would be really interesting to use directly thecount
symbol.-- In the referenced issue you @ktsn said you were about to work on this implementation, how is it going on? It would be a real type system feature improvement, hope you can do that.