|
|
|
@ -15,6 +15,7 @@ function assign(target) {
|
|
|
|
|
|
|
|
|
|
function destroy(detach) {
|
|
|
|
|
if (!this._destroyed) {
|
|
|
|
|
this.set = noop;
|
|
|
|
|
this.fire('destroy');
|
|
|
|
|
|
|
|
|
|
if (detach !== false) this._fragment.unmount();
|
|
|
|
@ -103,7 +104,6 @@ function on(eventName, handler) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function set(newState) {
|
|
|
|
|
if (this._destroyed) return;
|
|
|
|
|
this._set(assign({}, newState));
|
|
|
|
|
if (this._root._lock) return;
|
|
|
|
|
this._root._lock = true;
|
|
|
|
@ -158,7 +158,7 @@ function SvelteComponent ( options ) {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
this._handlers = Object.create( null );
|
|
|
|
|
this._handlers.destroy = [template.ondestroy.bind(this)];
|
|
|
|
|
this._handlers.destroy = [template.ondestroy];
|
|
|
|
|
|
|
|
|
|
this._root = options._root || this;
|
|
|
|
|
this._yield = options._yield;
|
|
|
|
|