Expose root as a public property

pull/1023/head
Emil Ajdyna 7 years ago
parent 7c86487691
commit fadeeaf177

@ -204,7 +204,7 @@ export default function dom(
const constructorBody = deindent`
${options.dev && `this._debugName = '${debugName}';`}
${options.dev && !generator.customElement &&
`if (!options || (!options.target && !options._root)) throw new Error("'target' is a required option");`}
`if (!options || (!options.target && !options.root)) throw new Error("'target' is a required option");`}
@init(this, options);
${generator.usesRefs && `this.refs = {};`}
this._state = @assign(${initialState.join(', ')});
@ -239,13 +239,13 @@ export default function dom(
${templateProperties.oncreate && `var _oncreate = %oncreate.bind(this);`}
${(templateProperties.oncreate || generator.hasComponents || generator.hasComplexBindings || generator.hasIntroTransitions) && deindent`
if (!options._root) {
if (!options.root) {
this._oncreate = [${templateProperties.oncreate && `_oncreate`}];
${(generator.hasComponents || generator.hasComplexBindings) && `this._beforecreate = [];`}
${(generator.hasComponents || generator.hasIntroTransitions) && `this._aftercreate = [];`}
} ${templateProperties.oncreate && deindent`
else {
this._root._oncreate.push(_oncreate);
this.root._oncreate.push(_oncreate);
}
`}
`}

@ -68,7 +68,7 @@ export default class Component extends Node {
const name = this.var;
const componentInitProperties = [`_root: #component._root`];
const componentInitProperties = [`root: #component.root`];
if (this.children.length > 0) {
const slots = Array.from(this._slots).map(name => `${name}: @createFragment()`);
@ -217,7 +217,7 @@ export default class Component extends Node {
`);
beforecreate = deindent`
#component._root._beforecreate.push(function() {
#component.root._beforecreate.push(function() {
var state = #component.get(), childState = ${name}.get(), newState = {};
if (!childState) return;
${setParentFromChildOnInit}

@ -527,7 +527,7 @@ export default class Element extends Node {
this.generator.hasComplexBindings = true;
block.builders.hydrate.addLine(
`if (!(${allInitialStateIsDefined})) #component._root._beforecreate.push(${handler});`
`if (!(${allInitialStateIsDefined})) #component.root._beforecreate.push(${handler});`
);
}
});
@ -556,7 +556,7 @@ export default class Element extends Node {
const fn = `%transitions-${intro.name}`;
block.builders.intro.addBlock(deindent`
#component._root._aftercreate.push(function() {
#component.root._aftercreate.push(function() {
if (!${name}) ${name} = @wrapTransition(#component, ${this.var}, ${fn}, ${snippet}, true, null);
${name}.run(true, function() {
#component.fire("intro.end", { node: ${this.var} });
@ -593,7 +593,7 @@ export default class Element extends Node {
}
block.builders.intro.addBlock(deindent`
#component._root._aftercreate.push(function() {
#component.root._aftercreate.push(function() {
${introName} = @wrapTransition(#component, ${this.var}, ${fn}, ${snippet}, true, null);
${introName}.run(true, function() {
#component.fire("intro.end", { node: ${this.var} });

@ -67,11 +67,11 @@ export function get(key) {
export function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._root = options._root || component;
component._bind = options._bind;
component.options = options;
component.store = component._root.options.store;
component.root = options.root || component;
component.store = component.root.options.store;
}
export function observe(key, callback, options) {
@ -136,12 +136,12 @@ export function onDev(eventName, handler) {
export function set(newState) {
this._set(assign({}, newState));
if (this._root._lock) return;
this._root._lock = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._lock = false;
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
export function _set(newState) {

@ -93,11 +93,11 @@ function get(key) {
function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._root = options._root || component;
component._bind = options._bind;
component.options = options;
component.store = component._root.options.store;
component.root = options.root || component;
component.store = component.root.options.store;
}
function observe(key, callback, options) {
@ -137,12 +137,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._lock) return;
this._root._lock = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._lock = false;
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {

@ -69,11 +69,11 @@ function get(key) {
function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._root = options._root || component;
component._bind = options._bind;
component.options = options;
component.store = component._root.options.store;
component.root = options.root || component;
component.store = component.root.options.store;
}
function observe(key, callback, options) {
@ -113,12 +113,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._lock) return;
this._root._lock = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._lock = false;
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
@ -174,7 +174,7 @@ var Nested = window.Nested;
function create_main_fragment(state, component) {
var nested = new Nested({
_root: component._root,
root: component.root,
data: { foo: "bar" }
});
@ -203,7 +203,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
if (!options._root) {
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];

@ -6,7 +6,7 @@ var Nested = window.Nested;
function create_main_fragment(state, component) {
var nested = new Nested({
_root: component._root,
root: component.root,
data: { foo: "bar" }
});
@ -35,7 +35,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
if (!options._root) {
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];

@ -69,11 +69,11 @@ function get(key) {
function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._root = options._root || component;
component._bind = options._bind;
component.options = options;
component.store = component._root.options.store;
component.root = options.root || component;
component.store = component.root.options.store;
}
function observe(key, callback, options) {
@ -113,12 +113,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._lock) return;
this._root._lock = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._lock = false;
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {

@ -89,11 +89,11 @@ function get(key) {
function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._root = options._root || component;
component._bind = options._bind;
component.options = options;
component.store = component._root.options.store;
component.root = options.root || component;
component.store = component.root.options.store;
}
function observe(key, callback, options) {
@ -133,12 +133,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._lock) return;
this._root._lock = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._lock = false;
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {

@ -81,11 +81,11 @@ function get(key) {
function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._root = options._root || component;
component._bind = options._bind;
component.options = options;
component.store = component._root.options.store;
component.root = options.root || component;
component.store = component.root.options.store;
}
function observe(key, callback, options) {
@ -125,12 +125,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._lock) return;
this._root._lock = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._lock = false;
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {

@ -85,11 +85,11 @@ function get(key) {
function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._root = options._root || component;
component._bind = options._bind;
component.options = options;
component.store = component._root.options.store;
component.root = options.root || component;
component.store = component.root.options.store;
}
function observe(key, callback, options) {
@ -129,12 +129,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._lock) return;
this._root._lock = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._lock = false;
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {

@ -89,11 +89,11 @@ function get(key) {
function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._root = options._root || component;
component._bind = options._bind;
component.options = options;
component.store = component._root.options.store;
component.root = options.root || component;
component.store = component.root.options.store;
}
function observe(key, callback, options) {
@ -133,12 +133,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._lock) return;
this._root._lock = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._lock = false;
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {

@ -89,11 +89,11 @@ function get(key) {
function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._root = options._root || component;
component._bind = options._bind;
component.options = options;
component.store = component._root.options.store;
component.root = options.root || component;
component.store = component.root.options.store;
}
function observe(key, callback, options) {
@ -133,12 +133,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._lock) return;
this._root._lock = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._lock = false;
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {

@ -101,11 +101,11 @@ function get(key) {
function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._root = options._root || component;
component._bind = options._bind;
component.options = options;
component.store = component._root.options.store;
component.root = options.root || component;
component.store = component.root.options.store;
}
function observe(key, callback, options) {
@ -145,12 +145,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._lock) return;
this._root._lock = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._lock = false;
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {

@ -81,11 +81,11 @@ function get(key) {
function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._root = options._root || component;
component._bind = options._bind;
component.options = options;
component.store = component._root.options.store;
component.root = options.root || component;
component.store = component.root.options.store;
}
function observe(key, callback, options) {
@ -125,12 +125,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._lock) return;
this._root._lock = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._lock = false;
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {

@ -85,11 +85,11 @@ function get(key) {
function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._root = options._root || component;
component._bind = options._bind;
component.options = options;
component.store = component._root.options.store;
component.root = options.root || component;
component.store = component.root.options.store;
}
function observe(key, callback, options) {
@ -129,12 +129,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._lock) return;
this._root._lock = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._lock = false;
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {

@ -85,11 +85,11 @@ function get(key) {
function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._root = options._root || component;
component._bind = options._bind;
component.options = options;
component.store = component._root.options.store;
component.root = options.root || component;
component.store = component.root.options.store;
}
function observe(key, callback, options) {
@ -129,12 +129,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._lock) return;
this._root._lock = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._lock = false;
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {

@ -85,11 +85,11 @@ function get(key) {
function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._root = options._root || component;
component._bind = options._bind;
component.options = options;
component.store = component._root.options.store;
component.root = options.root || component;
component.store = component.root.options.store;
}
function observe(key, callback, options) {
@ -129,12 +129,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._lock) return;
this._root._lock = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._lock = false;
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {

@ -85,11 +85,11 @@ function get(key) {
function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._root = options._root || component;
component._bind = options._bind;
component.options = options;
component.store = component._root.options.store;
component.root = options.root || component;
component.store = component.root.options.store;
}
function observe(key, callback, options) {
@ -129,12 +129,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._lock) return;
this._root._lock = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._lock = false;
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {

@ -85,11 +85,11 @@ function get(key) {
function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._root = options._root || component;
component._bind = options._bind;
component.options = options;
component.store = component._root.options.store;
component.root = options.root || component;
component.store = component.root.options.store;
}
function observe(key, callback, options) {
@ -129,12 +129,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._lock) return;
this._root._lock = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._lock = false;
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {

@ -85,11 +85,11 @@ function get(key) {
function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._root = options._root || component;
component._bind = options._bind;
component.options = options;
component.store = component._root.options.store;
component.root = options.root || component;
component.store = component.root.options.store;
}
function observe(key, callback, options) {
@ -129,12 +129,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._lock) return;
this._root._lock = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._lock = false;
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {

@ -89,11 +89,11 @@ function get(key) {
function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._root = options._root || component;
component._bind = options._bind;
component.options = options;
component.store = component._root.options.store;
component.root = options.root || component;
component.store = component.root.options.store;
}
function observe(key, callback, options) {
@ -133,12 +133,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._lock) return;
this._root._lock = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._lock = false;
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {

@ -87,11 +87,11 @@ function get(key) {
function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._root = options._root || component;
component._bind = options._bind;
component.options = options;
component.store = component._root.options.store;
component.root = options.root || component;
component.store = component.root.options.store;
}
function observe(key, callback, options) {
@ -131,12 +131,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._lock) return;
this._root._lock = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._lock = false;
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {

@ -104,11 +104,11 @@ function get(key) {
function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._root = options._root || component;
component._bind = options._bind;
component.options = options;
component.store = component._root.options.store;
component.root = options.root || component;
component.store = component.root.options.store;
}
function observe(key, callback, options) {
@ -148,12 +148,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._lock) return;
this._root._lock = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._lock = false;
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {

@ -97,11 +97,11 @@ function get(key) {
function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._root = options._root || component;
component._bind = options._bind;
component.options = options;
component.store = component._root.options.store;
component.root = options.root || component;
component.store = component.root.options.store;
}
function observe(key, callback, options) {
@ -141,12 +141,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._lock) return;
this._root._lock = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._lock = false;
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
@ -234,15 +234,15 @@ function create_main_fragment(state, component) {
h: function hydrate() {
addListener(audio, "timeupdate", audio_timeupdate_handler);
if (!('played' in state && 'currentTime' in state)) component._root._beforecreate.push(audio_timeupdate_handler);
if (!('played' in state && 'currentTime' in state)) component.root._beforecreate.push(audio_timeupdate_handler);
addListener(audio, "durationchange", audio_durationchange_handler);
if (!('duration' in state)) component._root._beforecreate.push(audio_durationchange_handler);
if (!('duration' in state)) component.root._beforecreate.push(audio_durationchange_handler);
addListener(audio, "play", audio_play_pause_handler);
addListener(audio, "pause", audio_play_pause_handler);
addListener(audio, "progress", audio_progress_handler);
if (!('buffered' in state)) component._root._beforecreate.push(audio_progress_handler);
if (!('buffered' in state)) component.root._beforecreate.push(audio_progress_handler);
addListener(audio, "loadedmetadata", audio_loadedmetadata_handler);
if (!('buffered' in state && 'seekable' in state)) component._root._beforecreate.push(audio_loadedmetadata_handler);
if (!('buffered' in state && 'seekable' in state)) component.root._beforecreate.push(audio_loadedmetadata_handler);
},
m: function mount(target, anchor) {
@ -273,7 +273,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
if (!options._root) {
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
}

@ -38,15 +38,15 @@ function create_main_fragment(state, component) {
h: function hydrate() {
addListener(audio, "timeupdate", audio_timeupdate_handler);
if (!('played' in state && 'currentTime' in state)) component._root._beforecreate.push(audio_timeupdate_handler);
if (!('played' in state && 'currentTime' in state)) component.root._beforecreate.push(audio_timeupdate_handler);
addListener(audio, "durationchange", audio_durationchange_handler);
if (!('duration' in state)) component._root._beforecreate.push(audio_durationchange_handler);
if (!('duration' in state)) component.root._beforecreate.push(audio_durationchange_handler);
addListener(audio, "play", audio_play_pause_handler);
addListener(audio, "pause", audio_play_pause_handler);
addListener(audio, "progress", audio_progress_handler);
if (!('buffered' in state)) component._root._beforecreate.push(audio_progress_handler);
if (!('buffered' in state)) component.root._beforecreate.push(audio_progress_handler);
addListener(audio, "loadedmetadata", audio_loadedmetadata_handler);
if (!('buffered' in state && 'seekable' in state)) component._root._beforecreate.push(audio_loadedmetadata_handler);
if (!('buffered' in state && 'seekable' in state)) component.root._beforecreate.push(audio_loadedmetadata_handler);
},
m: function mount(target, anchor) {
@ -77,7 +77,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
if (!options._root) {
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
}

@ -83,11 +83,11 @@ function get(key) {
function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._root = options._root || component;
component._bind = options._bind;
component.options = options;
component.store = component._root.options.store;
component.root = options.root || component;
component.store = component.root.options.store;
}
function observe(key, callback, options) {
@ -127,12 +127,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._lock) return;
this._root._lock = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._lock = false;
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
@ -187,11 +187,11 @@ function create_main_fragment(state, component) {
var text;
var imported = new Imported({
_root: component._root
root: component.root
});
var nonimported = new NonImported({
_root: component._root
root: component.root
});
return {
@ -226,7 +226,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
if (!options._root) {
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];

@ -8,11 +8,11 @@ function create_main_fragment(state, component) {
var text;
var imported = new Imported({
_root: component._root
root: component.root
});
var nonimported = new NonImported({
_root: component._root
root: component.root
});
return {
@ -47,7 +47,7 @@ function SvelteComponent(options) {
init(this, options);
this._state = assign({}, options.data);
if (!options._root) {
if (!options.root) {
this._oncreate = [];
this._beforecreate = [];
this._aftercreate = [];

@ -69,11 +69,11 @@ function get(key) {
function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._root = options._root || component;
component._bind = options._bind;
component.options = options;
component.store = component._root.options.store;
component.root = options.root || component;
component.store = component.root.options.store;
}
function observe(key, callback, options) {
@ -113,12 +113,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._lock) return;
this._root._lock = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._lock = false;
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
@ -196,10 +196,10 @@ function SvelteComponent(options) {
var _oncreate = oncreate.bind(this);
if (!options._root) {
if (!options.root) {
this._oncreate = [_oncreate];
} else {
this._root._oncreate.push(_oncreate);
this.root._oncreate.push(_oncreate);
}
this._fragment = create_main_fragment(this._state, this);

@ -28,10 +28,10 @@ function SvelteComponent(options) {
var _oncreate = oncreate.bind(this);
if (!options._root) {
if (!options.root) {
this._oncreate = [_oncreate];
} else {
this._root._oncreate.push(_oncreate);
this.root._oncreate.push(_oncreate);
}
this._fragment = create_main_fragment(this._state, this);

@ -69,11 +69,11 @@ function get(key) {
function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._root = options._root || component;
component._bind = options._bind;
component.options = options;
component.store = component._root.options.store;
component.root = options.root || component;
component.store = component.root.options.store;
}
function observe(key, callback, options) {
@ -113,12 +113,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._lock) return;
this._root._lock = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._lock = false;
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {

@ -93,11 +93,11 @@ function get(key) {
function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._root = options._root || component;
component._bind = options._bind;
component.options = options;
component.store = component._root.options.store;
component.root = options.root || component;
component.store = component.root.options.store;
}
function observe(key, callback, options) {
@ -137,12 +137,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._lock) return;
this._root._lock = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._lock = false;
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {

@ -89,11 +89,11 @@ function get(key) {
function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._root = options._root || component;
component._bind = options._bind;
component.options = options;
component.store = component._root.options.store;
component.root = options.root || component;
component.store = component.root.options.store;
}
function observe(key, callback, options) {
@ -133,12 +133,12 @@ function on(eventName, handler) {
function set(newState) {
this._set(assign({}, newState));
if (this._root._lock) return;
this._root._lock = true;
callAll(this._root._beforecreate);
callAll(this._root._oncreate);
callAll(this._root._aftercreate);
this._root._lock = false;
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {

Loading…
Cancel
Save