-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat no invalidate reactive vars if dependencies are all static
- Loading branch information
Showing
5 changed files
with
85 additions
and
5 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
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,60 @@ | ||
/* generated by Svelte vX.Y.Z */ | ||
import { | ||
SvelteComponent, | ||
detach, | ||
element, | ||
init, | ||
insert, | ||
noop, | ||
safe_not_equal, | ||
set_data, | ||
space, | ||
text | ||
} from "svelte/internal"; | ||
|
||
function create_fragment(ctx) { | ||
let h1; | ||
let t3; | ||
let t4; | ||
|
||
return { | ||
c() { | ||
h1 = element("h1"); | ||
h1.textContent = `Hello ${name}!`; | ||
t3 = space(); | ||
t4 = text(/*foo*/ ctx[0]); | ||
}, | ||
m(target, anchor) { | ||
insert(target, h1, anchor); | ||
insert(target, t3, anchor); | ||
insert(target, t4, anchor); | ||
}, | ||
p(ctx, [dirty]) { | ||
if (dirty & /*foo*/ 1) set_data(t4, /*foo*/ ctx[0]); | ||
}, | ||
i: noop, | ||
o: noop, | ||
d(detaching) { | ||
if (detaching) detach(h1); | ||
if (detaching) detach(t3); | ||
if (detaching) detach(t4); | ||
} | ||
}; | ||
} | ||
|
||
let name = "world"; | ||
|
||
function instance($$self) { | ||
let foo; | ||
$: foo = name + name; | ||
return [foo]; | ||
} | ||
|
||
class Component extends SvelteComponent { | ||
constructor(options) { | ||
super(); | ||
init(this, options, instance, create_fragment, safe_not_equal, {}); | ||
} | ||
} | ||
|
||
export default Component; |
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,7 @@ | ||
<script> | ||
let name = 'world'; | ||
$: foo = name + name; | ||
</script> | ||
|
||
<h1>Hello {name}!</h1> | ||
{foo} |