|
|
@ -80,8 +80,6 @@ function init(component, options) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function on(eventName, handler) {
|
|
|
|
function on(eventName, handler) {
|
|
|
|
if (eventName === 'teardown') return this.on('destroy', handler);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
|
|
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
|
|
|
|
handlers.push(handler);
|
|
|
|
handlers.push(handler);
|
|
|
|
|
|
|
|
|
|
|
@ -93,17 +91,6 @@ function on(eventName, handler) {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function onDev(eventName, handler) {
|
|
|
|
|
|
|
|
if (eventName === 'teardown') {
|
|
|
|
|
|
|
|
console.warn(
|
|
|
|
|
|
|
|
"Use component.on('destroy', ...) instead of component.on('teardown', ...) which has been deprecated and will be unsupported in Svelte 2"
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
return this.on('destroy', handler);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return on.call(this, eventName, handler);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function set(newState) {
|
|
|
|
function set(newState) {
|
|
|
|
this._set(assign({}, newState));
|
|
|
|
this._set(assign({}, newState));
|
|
|
|
if (this.root._lock) return;
|
|
|
|
if (this.root._lock) return;
|
|
|
@ -162,7 +149,7 @@ var protoDev = {
|
|
|
|
destroy: destroyDev,
|
|
|
|
destroy: destroyDev,
|
|
|
|
get,
|
|
|
|
get,
|
|
|
|
fire,
|
|
|
|
fire,
|
|
|
|
on: onDev,
|
|
|
|
on,
|
|
|
|
set: setDev,
|
|
|
|
set: setDev,
|
|
|
|
_recompute: noop,
|
|
|
|
_recompute: noop,
|
|
|
|
_set,
|
|
|
|
_set,
|
|
|
|