-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix each blocks not unmounting components correctly (#3056)
* Prevent outro from invoking detach multiple times * Add tests for unmounting entries in an each block * Remove redundant function for removing from lookup
- Loading branch information
1 parent
f9054bc
commit 7b5f176
Showing
4 changed files
with
42 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<script> | ||
export let title; | ||
</script> | ||
|
||
<p>{title}</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
export default { | ||
props: { | ||
titles: [{ name: 'a', }, { name: 'b' }, { name: 'c' }] | ||
}, | ||
|
||
html: ` | ||
<p>a</p> | ||
<p>b</p> | ||
<p>c</p> | ||
`, | ||
|
||
test({ assert, component, target }) { | ||
component.titles = [{ name: 'b' }, { name: 'c' }]; | ||
|
||
assert.htmlEqual(target.innerHTML, ` | ||
<p>b</p> | ||
<p>c</p> | ||
`); | ||
|
||
component.titles = [{ name: 'c' }]; | ||
|
||
assert.htmlEqual(target.innerHTML, ` | ||
<p>c</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<script> | ||
import Nested from './Nested.svelte'; | ||
export let titles; | ||
</script> | ||
|
||
{#each titles as title (title.name)} | ||
<Nested title="{title.name}"/> | ||
{/each} |