You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
It's totally valid to create a store without an initial value, but TypeScript complains:
Expected behavior store = writable() etc should be accepted by TypeScript. I guess value: T here just needs to be value?: T (and similarly for readable)?
Fixes#6291Fixes#6345
Both writable and readable initialized without any arguments are already valid, but TS complains about it. This makes both allowed to be emptily initialized. It's also possible to invoke readable with one argument only.
Describe the bug
It's totally valid to create a store without an initial value, but TypeScript complains:
Expected behavior
store = writable()
etc should be accepted by TypeScript. I guessvalue: T
here just needs to bevalue?: T
(and similarly forreadable
)?svelte/src/runtime/store/index.ts
Line 64 in 086cff2
Information about your Svelte project:
It's a SvelteKit project using
[email protected]
Severity
Minor — easily worked around with
writable(undefined)
The text was updated successfully, but these errors were encountered: