-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
fix: allow writable/readable empty initialization #6293
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like there aren't any problems with the changes!
This should now fix #6345 as well |
I think you need to update the docs some more, right now they tell you that the second argument is required, which would be no longer the case. Other than this this looks good 👍 |
Oops, nice catch. Done! |
Just to be extra safe: Could you add
to https://github.com/sveltejs/svelte/blob/master/test/store/index.js ? That would be great. |
Good idea, done! I was confused why Line 11 in 3301b09
|
Thank you! 👍 |
Fixes #6291
Fixes #6345
Both
writable
andreadable
initialized without any arguments are already valid, but TS complains about it. This makes both allowed to be emptily initialized. A special exception toreadable
, although it's valid to use empty initialization (not sure why anyone would do this), when the first argument is passed, the callback is required to be defined as well (according to the docs).Before submitting the PR, please make sure you do the following