mirror of https://github.com/sveltejs/svelte
parent
7f97f954b2
commit
4c6c4c6e97
@ -0,0 +1,46 @@
|
||||
/* generated by Svelte vX.Y.Z */
|
||||
import {
|
||||
SvelteComponent,
|
||||
component_subscribe,
|
||||
init,
|
||||
noop,
|
||||
safe_not_equal,
|
||||
set_store_value
|
||||
} from "svelte/internal";
|
||||
import { count } from "./store.js";
|
||||
|
||||
function create_fragment(ctx) {
|
||||
return {
|
||||
c: noop,
|
||||
m: noop,
|
||||
p: noop,
|
||||
i: noop,
|
||||
o: noop,
|
||||
d: noop
|
||||
};
|
||||
}
|
||||
|
||||
function instance($$self, $$props, $$invalidate) {
|
||||
let $count;
|
||||
|
||||
component_subscribe($$self, count, $$value => $$invalidate('$count', $count = $$value));
|
||||
|
||||
function increment() {
|
||||
set_store_value(count, $count++, $count);
|
||||
}
|
||||
|
||||
return { increment };
|
||||
}
|
||||
|
||||
class Component extends SvelteComponent {
|
||||
constructor(options) {
|
||||
super();
|
||||
init(this, options, instance, create_fragment, safe_not_equal, ["increment"]);
|
||||
}
|
||||
|
||||
get increment() {
|
||||
return this.$$.ctx.increment;
|
||||
}
|
||||
}
|
||||
|
||||
export default Component;
|
@ -0,0 +1,7 @@
|
||||
<script>
|
||||
import { count } from './store.js';
|
||||
|
||||
export function increment() {
|
||||
$count++;
|
||||
}
|
||||
</script>
|
@ -0,0 +1,3 @@
|
||||
import { writable } from '../../../../store';
|
||||
|
||||
export const count = writable(0);
|
Loading…
Reference in new issue