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/component-static/expected.js

67 lines
1.2 KiB

/* generated by Svelte vX.Y.Z */
import { assign, callAll, init, noop, proto } from "svelte/shared.js";
var template = (function() {
return {
components: {
Nested: window.Nested
}
};
}());
function create_main_fragment(state, component) {
var nested = new template.components.Nested({
_root: component._root,
data: { foo: "bar" }
});
return {
create: function() {
nested._fragment.create();
},
mount: function(target, anchor) {
nested._mount(target, anchor);
},
update: noop,
unmount: function() {
nested._unmount();
},
destroy: function() {
nested.destroy(false);
}
};
}
function SvelteComponent(options) {
init(this, options);
this._state = options.data || {};
if (!options._root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];
}
this._fragment = create_main_fragment(this._state, this);
if (options.target) {
this._fragment.create();
this._fragment.mount(options.target, options.anchor || null);
this._lock = true;
callAll(this._beforecreate);
callAll(this._oncreate);
callAll(this._aftercreate);
this._lock = false;
}
}
assign(SvelteComponent.prototype, proto);
export default SvelteComponent;