mirror of https://github.com/sveltejs/svelte
Merge pull request #1980 from evs-chris/gh-1952-evschris
First pass at tracking mutation to avoid unnecessary update code - #1952pull/1983/head
commit
4c9a55cb66
@ -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