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/img-bindings/expected.js

65 lines
1.2 KiB

/* generated by Svelte vX.Y.Z */
import {
SvelteComponent,
add_render_callback,
detach,
element,
init,
insert,
listen,
noop,
safe_not_equal
} from "svelte/internal";
function create_fragment(ctx) {
let img;
let mounted;
let dispose;
return {
c() {
img = element("img");
if (/*complete*/ ctx[0] === void 0) add_render_callback(() => /*img_load_handler*/ ctx[1].call(img));
},
m(target, anchor) {
insert(target, img, anchor);
if (!mounted) {
dispose = listen(img, "load", /*img_load_handler*/ ctx[1]);
mounted = true;
}
},
p: noop,
i: noop,
o: noop,
d(detaching) {
if (detaching) detach(img);
mounted = false;
dispose();
}
};
}
function instance($$self, $$props, $$invalidate) {
let { complete } = $$props;
function img_load_handler() {
complete = this.complete;
$$invalidate(0, complete);
}
$$self.$$set = $$props => {
if ('complete' in $$props) $$invalidate(0, complete = $$props.complete);
};
return [complete, img_load_handler];
}
class Component extends SvelteComponent {
constructor(options) {
super();
init(this, options, instance, create_fragment, safe_not_equal, { complete: 0 });
}
}
export default Component;