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.
svelte/test/js/samples/action-custom-event-handler/expected.js

69 lines
1.1 KiB

/* generated by Svelte vX.Y.Z */
6 years ago
import {
SvelteComponent,
6 years ago
detach,
element,
init,
insert,
noop,
safe_not_equal
} from "svelte/internal";
function create_fragment(ctx) {
var button, foo_action;
return {
c() {
6 years ago
button = element("button");
button.textContent = "foo";
},
m(target, anchor) {
insert(target, button, anchor);
foo_action = foo.call(null, button, ctx.foo_function) || {};
},
p: noop,
i: noop,
o: noop,
6 years ago
d(detaching) {
if (detaching) {
detach(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 instance($$self, $$props, $$invalidate) {
let { bar } = $$props;
function foo_function() {
return handleFoo(bar);
}
6 years ago
$$self.$set = $$props => {
if ('bar' in $$props) $$invalidate('bar', bar = $$props.bar);
};
return { bar, foo_function };
}
class Component extends SvelteComponent {
constructor(options) {
super();
6 years ago
init(this, options, instance, create_fragment, safe_not_equal, ["bar"]);
}
}
export default Component;