-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: allow $store to be used with changing values including nullish v…
…alues (#7947) fixes #7555 breaking change: derived now throws an error if you pass falsy values --------- Co-authored-by: Simon Holthausen <simon.holthausen@vercel.com>
- Loading branch information
1 parent
d083f8a
commit ea73930
Showing
6 changed files
with
50 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
test/runtime/samples/store-auto-subscribe-removed-store/_config.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { writable } from '../../../../store'; | ||
|
||
export default { | ||
html: ` | ||
<p>undefined</p> | ||
`, | ||
async test({ assert, component, target }) { | ||
component.store = writable('foo'); | ||
assert.htmlEqual(target.innerHTML, ` | ||
<p>foo</p> | ||
`); | ||
component.store = undefined; | ||
assert.htmlEqual(target.innerHTML, ` | ||
<p>undefined</p> | ||
`); | ||
component.store = writable('bar'); | ||
assert.htmlEqual(target.innerHTML, ` | ||
<p>bar</p> | ||
`); | ||
} | ||
}; |
5 changes: 5 additions & 0 deletions
5
test/runtime/samples/store-auto-subscribe-removed-store/main.svelte
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<script> | ||
export let store; | ||
</script> | ||
|
||
<p>{$store}</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters