pull/3548/head
daszgfz 6 years ago
parent b9f7c51ad4
commit 97c15b5f49

@ -228,7 +228,7 @@ export default function dom(
return b`${`$$subscribe_${name}`}()`;
}
const callback = x`$$value => { $$invalidate('${value}', ${value} = $$value) }`;
const callback = x`$$value => $$invalidate('${value}', ${value} = $$value)`;
let insert = b`@component_subscribe($$self, ${name}, $${callback})`;
if (component.compile_options.dev) {
@ -356,7 +356,7 @@ export default function dom(
if (store && store.reassigned) {
const unsubscribe = `$$unsubscribe_${name}`;
const subscribe = `$$subscribe_${name}`;
return b`let ${$name}, ${unsubscribe} = @noop, ${subscribe} = () => (${unsubscribe}(), ${unsubscribe} = @subscribe(${name}, $$value => { $$invalidate('${$name}', ${$name} = $$value); }), ${name})`;
return b`let ${$name}, ${unsubscribe} = @noop, ${subscribe} = () => (${unsubscribe}(), ${unsubscribe} = @subscribe(${name}, $$value => $$invalidate('${$name}', ${$name} = $$value)), ${name})`;
}
return b`let ${$name};`;

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import {
SvelteComponent,
append,
@ -12,44 +11,37 @@ import {
set_data,
text
} from "svelte/internal";
import { writable } from "svelte/store";
function create_fragment(ctx) {
var h1, t;
let h1;
let t;
return {
c() {
h1 = element("h1");
t = text(ctx.$foo);
},
m(target, anchor) {
insert(target, h1, anchor);
append(h1, t);
},
p(changed, ctx) {
if (changed.$foo) {
set_data(t, ctx.$foo);
}
if (changed.$foo) set_data(t, ctx.$foo);
},
i: noop,
o: noop,
d(detaching) {
if (detaching) {
detach(h1);
}
if (detaching) detach(h1);
}
};
}
function instance($$self, $$props, $$invalidate) {
let $foo;
const foo = writable(0); component_subscribe($$self, foo, $$value => $$invalidate('$foo', $foo = $$value));
const foo = writable(0);
component_subscribe($$self, foo, $$value => $$invalidate("$foo", $foo = $$value));
return { foo, $foo };
}

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import {
SvelteComponent,
component_subscribe,
@ -7,6 +6,7 @@ import {
safe_not_equal,
set_store_value
} from "svelte/internal";
import { count } from "./store.js";
function create_fragment(ctx) {
@ -22,8 +22,7 @@ function create_fragment(ctx) {
function instance($$self, $$props, $$invalidate) {
let $count;
component_subscribe($$self, count, $$value => $$invalidate('$count', $count = $$value));
component_subscribe($$self, count, $$value => $$invalidate("$count", $count = $$value));
function increment() {
set_store_value(count, $count++, $count);

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import {
SvelteComponent,
append,
@ -14,10 +13,15 @@ import {
subscribe,
text
} from "svelte/internal";
import { writable } from "svelte/store";
function create_fragment(ctx) {
var h1, t0, t1, button, dispose;
let h1;
let t0;
let t1;
let button;
let dispose;
return {
c() {
@ -28,44 +32,35 @@ function create_fragment(ctx) {
button.textContent = "reset";
dispose = listen(button, "click", ctx.click_handler);
},
m(target, anchor) {
insert(target, h1, anchor);
append(h1, t0);
insert(target, t1, anchor);
insert(target, button, anchor);
},
p(changed, ctx) {
if (changed.$foo) {
set_data(t0, ctx.$foo);
}
if (changed.$foo) set_data(t0, ctx.$foo);
},
i: noop,
o: noop,
d(detaching) {
if (detaching) {
detach(h1);
detach(t1);
detach(button);
}
if (detaching) detach(h1);
if (detaching) detach(t1);
if (detaching) detach(button);
dispose();
}
};
}
function instance($$self, $$props, $$invalidate) {
let $foo, $$unsubscribe_foo = noop, $$subscribe_foo = () => ($$unsubscribe_foo(), $$unsubscribe_foo = subscribe(foo, $$value => $$invalidate('$foo', $foo = $$value)), foo);
let $foo,
$$unsubscribe_foo = noop,
$$subscribe_foo = () => ($$unsubscribe_foo(), $$unsubscribe_foo = subscribe(foo, $$value => $$invalidate("$foo", $foo = $$value)), foo);
$$self.$$.on_destroy.push(() => $$unsubscribe_foo());
let foo = writable(0); $$subscribe_foo();
const click_handler = () => $$subscribe_foo($$invalidate('foo', foo = writable(0)));
let foo = writable(0);
$$subscribe_foo();
const click_handler = () => $$subscribe_foo($$invalidate("foo", foo = writable(0)));
return { foo, $foo, click_handler };
}

@ -1,4 +1,3 @@
/* generated by Svelte vX.Y.Z */
import {
SvelteComponent,
add_render_callback,
@ -10,8 +9,7 @@ import {
} from "svelte/internal";
function create_fragment(ctx) {
var dispose;
let dispose;
add_render_callback(ctx.onlinestatuschanged);
return {
@ -21,12 +19,10 @@ function create_fragment(ctx) {
listen(window, "offline", ctx.onlinestatuschanged)
];
},
m: noop,
p: noop,
i: noop,
o: noop,
d(detaching) {
run_all(dispose);
}
@ -37,7 +33,7 @@ function instance($$self, $$props, $$invalidate) {
let online;
function onlinestatuschanged() {
$$invalidate('online', online = navigator.onLine);
$$invalidate("online", online = navigator.onLine);
}
return { online, onlinestatuschanged };

Loading…
Cancel
Save