-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Make start
mandatory in the Readable store api.
#8300
Comments
Making this mandatory would be a breaking change. As for why you might want a store that does not change - if you have some component/API that expects one of its props to be passed as a store, but you, the creator of the component or caller of the API, know that that value is never going to need to change, you can pass this constant store to the component/API. |
For more context: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the problem
There seems to be no reason to create a Readable store which does not change. Still, not only the Readable Store api allows it, but there is a test for it, demonstrating this is intentional (
svelte/test/store/index.ts
Line 144 in 5a3a1e4
This seems a meaningless change, but it may help people seeing stores for the first time.
Describe the proposed solution
I would like to make
start
mandatory for creating a readable store.Alternatives considered
Explain why it should be optional.
Importance
nice to have
The text was updated successfully, but these errors were encountered: