-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export ReactiveValue type #15075
Comments
I think there are multiple issues here, and this is why this is left up to the user:
Since I migrated to Svelte 5 and transformed all of my stores, I used a combination of the above: simple objects with Svelte is not opinionated at all, which is why the context system is as basic as it gets, with no type-safety included. I think this falls into the same category and best to also be left unopinionated. |
Fair enough, I agree that Svelte not being strictly opinionated is good in this case. Also good point about read-only values! However I'd still argue that a large majority of cases is covered by returning |
Describe the problem
Inside my library, I am currently trying to align the return types of my (user-facing) functions that return reactive values.
I adopted the standard set by
svelte/reactivity
of returning{ current: value }
. I see that internally this is achieved through ReactiveValue which also results in the return typeReactiveValue<T>
.Describe the proposed solution
Instead of me creating a very similar type - would it make sense to just export a
ReactiveValue
type? Maybe this would also promote some consistency across projects, as of today there is no standard on this topic. (you are free to use .current, .value, .ref...)Importance
nice to have
The text was updated successfully, but these errors were encountered: