mirror of https://github.com/sveltejs/svelte
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
76 lines
1.4 KiB
76 lines
1.4 KiB
6 years ago
|
/* generated by Svelte vX.Y.Z */
|
||
|
import { SvelteComponent as SvelteComponent_1, createElement, detachNode, flush, init, insert, noop, run, safe_not_equal } from "svelte/internal.js";
|
||
|
|
||
|
function create_fragment(component, ctx) {
|
||
|
var button, foo_action, current;
|
||
|
|
||
|
return {
|
||
|
c() {
|
||
|
button = createElement("button");
|
||
|
button.textContent = "foo";
|
||
|
},
|
||
|
|
||
|
m(target, anchor) {
|
||
|
insert(target, button, anchor);
|
||
|
foo_action = foo.call(null, button, ctx.foo_function) || {};
|
||
|
current = true;
|
||
|
},
|
||
|
|
||
|
p: noop,
|
||
|
|
||
|
i(target, anchor) {
|
||
|
if (current) return;
|
||
|
this.m(target, anchor);
|
||
|
},
|
||
|
|
||
|
o: run,
|
||
|
|
||
|
d(detach) {
|
||
|
if (detach) {
|
||
|
detachNode(button);
|
||
|
}
|
||
|
|
||
|
if (foo_action && typeof foo_action.destroy === 'function') foo_action.destroy();
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
|
||
|
function handleFoo(bar) {
|
||
|
console.log(bar);
|
||
|
}
|
||
|
|
||
|
function foo(node, callback) {
|
||
|
// code goes here
|
||
|
}
|
||
|
|
||
|
function define($$self, $$props) {
|
||
|
let { bar } = $$props;
|
||
|
|
||
|
function foo_function() {
|
||
|
return handleFoo(bar);
|
||
|
}
|
||
|
|
||
|
$$self.$$.get = () => ({ bar, foo_function });
|
||
|
|
||
|
$$self.$$.set = $$props => {
|
||
|
if ('bar' in $$props) bar = $$props.bar;
|
||
|
};
|
||
|
}
|
||
|
|
||
|
class SvelteComponent extends SvelteComponent_1 {
|
||
|
constructor(options) {
|
||
|
super();
|
||
|
init(this, options, define, create_fragment, safe_not_equal);
|
||
|
}
|
||
|
|
||
|
get bar() {
|
||
|
return this.$$.get().bar;
|
||
|
}
|
||
|
|
||
|
set bar(value) {
|
||
|
this.$set({ bar: value });
|
||
|
flush();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
export default SvelteComponent;
|