|
|
@ -103,7 +103,9 @@ function on(eventName, handler) {
|
|
|
|
|
|
|
|
|
|
|
|
function set(newState) {
|
|
|
|
function set(newState) {
|
|
|
|
this._set(assign({}, newState));
|
|
|
|
this._set(assign({}, newState));
|
|
|
|
|
|
|
|
callAll(this._root._beforecreate);
|
|
|
|
callAll(this._root._oncreate);
|
|
|
|
callAll(this._root._oncreate);
|
|
|
|
|
|
|
|
callAll(this._root._aftercreate);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function callAll(fns) {
|
|
|
|
function callAll(fns) {
|
|
|
@ -178,7 +180,12 @@ function SvelteComponent ( options ) {
|
|
|
|
this._yield = options._yield;
|
|
|
|
this._yield = options._yield;
|
|
|
|
|
|
|
|
|
|
|
|
this._torndown = false;
|
|
|
|
this._torndown = false;
|
|
|
|
this._oncreate = [];
|
|
|
|
|
|
|
|
|
|
|
|
if ( !options._root ) {
|
|
|
|
|
|
|
|
this._oncreate = [];
|
|
|
|
|
|
|
|
this._beforecreate = [];
|
|
|
|
|
|
|
|
this._aftercreate = [];
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this._fragment = create_main_fragment( this._state, this );
|
|
|
|
this._fragment = create_main_fragment( this._state, this );
|
|
|
|
|
|
|
|
|
|
|
@ -187,7 +194,9 @@ function SvelteComponent ( options ) {
|
|
|
|
this._fragment.mount( options.target, null );
|
|
|
|
this._fragment.mount( options.target, null );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
callAll(this._beforecreate);
|
|
|
|
callAll(this._oncreate);
|
|
|
|
callAll(this._oncreate);
|
|
|
|
|
|
|
|
callAll(this._aftercreate);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
assign( SvelteComponent.prototype, proto );
|
|
|
|
assign( SvelteComponent.prototype, proto );
|
|
|
@ -197,7 +206,6 @@ SvelteComponent.prototype._set = function _set ( newState ) {
|
|
|
|
this._state = assign( {}, oldState, newState );
|
|
|
|
this._state = assign( {}, oldState, newState );
|
|
|
|
dispatchObservers( this, this._observers.pre, newState, oldState );
|
|
|
|
dispatchObservers( this, this._observers.pre, newState, oldState );
|
|
|
|
dispatchObservers( this, this._observers.post, newState, oldState );
|
|
|
|
dispatchObservers( this, this._observers.post, newState, oldState );
|
|
|
|
callAll(this._oncreate);
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
SvelteComponent.prototype.teardown = SvelteComponent.prototype.destroy = function destroy ( detach ) {
|
|
|
|
SvelteComponent.prototype.teardown = SvelteComponent.prototype.destroy = function destroy ( detach ) {
|
|
|
|