mirror of https://github.com/sveltejs/svelte
first pass at tracking mutation to avoid unnecessary update code - #1952
also tracks mutation on child refs of const declarations - #1917pull/1980/head
parent
8e9f37a7d4
commit
e85222ad84
@ -0,0 +1,53 @@
|
||||
/* generated by Svelte vX.Y.Z */
|
||||
import { SvelteComponent as SvelteComponent_1, append, createElement, createText, detachNode, init, insert, noop, run, safe_not_equal } from "svelte/internal";
|
||||
|
||||
function create_fragment($$, ctx) {
|
||||
var h1, text0, text1, text2, current;
|
||||
|
||||
return {
|
||||
c() {
|
||||
h1 = createElement("h1");
|
||||
text0 = createText("Hello ");
|
||||
text1 = createText(ctx.name);
|
||||
text2 = createText("!");
|
||||
},
|
||||
|
||||
m(target, anchor) {
|
||||
insert(target, h1, anchor);
|
||||
append(h1, text0);
|
||||
append(h1, text1);
|
||||
append(h1, text2);
|
||||
current = true;
|
||||
},
|
||||
|
||||
p: noop,
|
||||
|
||||
i(target, anchor) {
|
||||
if (current) return;
|
||||
this.m(target, anchor);
|
||||
},
|
||||
|
||||
o: run,
|
||||
|
||||
d(detach) {
|
||||
if (detach) {
|
||||
detachNode(h1);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function instance($$self) {
|
||||
let name = 'world';
|
||||
|
||||
return { name };
|
||||
}
|
||||
|
||||
class SvelteComponent extends SvelteComponent_1 {
|
||||
constructor(options) {
|
||||
super();
|
||||
init(this, options, instance, create_fragment, safe_not_equal);
|
||||
}
|
||||
}
|
||||
|
||||
export default SvelteComponent;
|
@ -0,0 +1,5 @@
|
||||
<script>
|
||||
let name = 'world';
|
||||
</script>
|
||||
|
||||
<h1>Hello {name}!</h1>
|
Loading…
Reference in new issue