diff --git a/test/js/samples/action/expected-bundle.js b/test/js/samples/action/expected-bundle.js index e316279a1c..c58cbdcea3 100644 --- a/test/js/samples/action/expected-bundle.js +++ b/test/js/samples/action/expected-bundle.js @@ -51,8 +51,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -64,18 +64,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -134,18 +122,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/collapses-text-around-comments/_actual-bundle-v2.js b/test/js/samples/collapses-text-around-comments/_actual-bundle-v2.js index af5c88e152..1c6d4db78a 100644 --- a/test/js/samples/collapses-text-around-comments/_actual-bundle-v2.js +++ b/test/js/samples/collapses-text-around-comments/_actual-bundle-v2.js @@ -59,8 +59,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -72,18 +72,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -142,18 +130,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/collapses-text-around-comments/expected-bundle-v2.js b/test/js/samples/collapses-text-around-comments/expected-bundle-v2.js index af5c88e152..1c6d4db78a 100644 --- a/test/js/samples/collapses-text-around-comments/expected-bundle-v2.js +++ b/test/js/samples/collapses-text-around-comments/expected-bundle-v2.js @@ -59,8 +59,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -72,18 +72,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -142,18 +130,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/collapses-text-around-comments/expected-bundle.js b/test/js/samples/collapses-text-around-comments/expected-bundle.js index af5c88e152..1c6d4db78a 100644 --- a/test/js/samples/collapses-text-around-comments/expected-bundle.js +++ b/test/js/samples/collapses-text-around-comments/expected-bundle.js @@ -59,8 +59,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -72,18 +72,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -142,18 +130,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/component-static-immutable/expected-bundle.js b/test/js/samples/component-static-immutable/expected-bundle.js index 27aa216840..959b6fea56 100644 --- a/test/js/samples/component-static-immutable/expected-bundle.js +++ b/test/js/samples/component-static-immutable/expected-bundle.js @@ -43,8 +43,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -56,18 +56,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -126,18 +114,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/component-static-immutable2/expected-bundle.js b/test/js/samples/component-static-immutable2/expected-bundle.js index 27aa216840..959b6fea56 100644 --- a/test/js/samples/component-static-immutable2/expected-bundle.js +++ b/test/js/samples/component-static-immutable2/expected-bundle.js @@ -43,8 +43,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -56,18 +56,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -126,18 +114,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/component-static/expected-bundle.js b/test/js/samples/component-static/expected-bundle.js index 91fb33207b..b7f9dcbbb9 100644 --- a/test/js/samples/component-static/expected-bundle.js +++ b/test/js/samples/component-static/expected-bundle.js @@ -39,8 +39,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -52,18 +52,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -122,18 +110,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/computed-collapsed-if/expected-bundle.js b/test/js/samples/computed-collapsed-if/expected-bundle.js index 95e448f874..5ed48c2966 100644 --- a/test/js/samples/computed-collapsed-if/expected-bundle.js +++ b/test/js/samples/computed-collapsed-if/expected-bundle.js @@ -39,8 +39,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -52,18 +52,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -122,18 +110,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/css-media-query/expected-bundle.js b/test/js/samples/css-media-query/expected-bundle.js index 79e3e3e456..f4076b1213 100644 --- a/test/js/samples/css-media-query/expected-bundle.js +++ b/test/js/samples/css-media-query/expected-bundle.js @@ -55,8 +55,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -68,18 +68,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -138,18 +126,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js b/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js index e320ba4218..edf44bfd7a 100644 --- a/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js +++ b/test/js/samples/css-shadow-dom-keyframes/expected-bundle.js @@ -51,8 +51,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -64,18 +64,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -134,18 +122,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/deconflict-builtins/_actual-bundle-v2.js b/test/js/samples/deconflict-builtins/_actual-bundle-v2.js index a8dcb7e5f4..e895d021e6 100644 --- a/test/js/samples/deconflict-builtins/_actual-bundle-v2.js +++ b/test/js/samples/deconflict-builtins/_actual-bundle-v2.js @@ -69,8 +69,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -82,18 +82,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -152,18 +140,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/deconflict-builtins/expected-bundle-v2.js b/test/js/samples/deconflict-builtins/expected-bundle-v2.js index a8dcb7e5f4..e895d021e6 100644 --- a/test/js/samples/deconflict-builtins/expected-bundle-v2.js +++ b/test/js/samples/deconflict-builtins/expected-bundle-v2.js @@ -69,8 +69,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -82,18 +82,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -152,18 +140,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/deconflict-builtins/expected-bundle.js b/test/js/samples/deconflict-builtins/expected-bundle.js index ee08884e3d..1e9eb4b709 100644 --- a/test/js/samples/deconflict-builtins/expected-bundle.js +++ b/test/js/samples/deconflict-builtins/expected-bundle.js @@ -69,8 +69,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -82,18 +82,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -152,18 +140,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/deconflict-globals/expected-bundle.js b/test/js/samples/deconflict-globals/expected-bundle.js index 17898cf414..8d23561dec 100644 --- a/test/js/samples/deconflict-globals/expected-bundle.js +++ b/test/js/samples/deconflict-globals/expected-bundle.js @@ -39,8 +39,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -52,18 +52,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -122,18 +110,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/dev-warning-missing-data-computed/_actual-bundle-v2.js b/test/js/samples/dev-warning-missing-data-computed/_actual-bundle-v2.js index 69a58fa933..c048d39b99 100644 --- a/test/js/samples/dev-warning-missing-data-computed/_actual-bundle-v2.js +++ b/test/js/samples/dev-warning-missing-data-computed/_actual-bundle-v2.js @@ -66,13 +66,8 @@ function fire(eventName, data) { } } -function getDev(key) { - if (key) console.warn("`let x = component.get('x')` is deprecated. Use `let { x } = component.get()` instead"); - return get.call(this, key); -} - -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -84,34 +79,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - -function observeDev(key, callback, options) { - console.warn("this.observe(key, (newValue, oldValue) => {...}) is deprecated. Use\n\n // runs before DOM updates\n this.on('state', ({ changed, current, previous }) => {...});\n\n // runs after DOM updates\n this.on('update', ...);\n\n...or add the observe method from the svelte-extras package"); - - var c = (key = '' + key).search(/[.[]/); - if (c > -1) { - var message = - 'The first argument to component.observe(...) must be the name of a top-level property'; - if (c > 0) - message += ", i.e. '" + key.slice(0, c) + "' rather than '" + key + "'"; - - throw new Error(message); - } - - return observe.call(this, key, callback, options); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -193,17 +160,15 @@ function _unmount() { var protoDev = { destroy: destroyDev, - get: getDev, - fire: fire, - observe: observeDev, + get, + fire, on: onDev, set: setDev, - teardown: destroyDev, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/dev-warning-missing-data-computed/expected-bundle-v2.js b/test/js/samples/dev-warning-missing-data-computed/expected-bundle-v2.js index 69a58fa933..c048d39b99 100644 --- a/test/js/samples/dev-warning-missing-data-computed/expected-bundle-v2.js +++ b/test/js/samples/dev-warning-missing-data-computed/expected-bundle-v2.js @@ -66,13 +66,8 @@ function fire(eventName, data) { } } -function getDev(key) { - if (key) console.warn("`let x = component.get('x')` is deprecated. Use `let { x } = component.get()` instead"); - return get.call(this, key); -} - -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -84,34 +79,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - -function observeDev(key, callback, options) { - console.warn("this.observe(key, (newValue, oldValue) => {...}) is deprecated. Use\n\n // runs before DOM updates\n this.on('state', ({ changed, current, previous }) => {...});\n\n // runs after DOM updates\n this.on('update', ...);\n\n...or add the observe method from the svelte-extras package"); - - var c = (key = '' + key).search(/[.[]/); - if (c > -1) { - var message = - 'The first argument to component.observe(...) must be the name of a top-level property'; - if (c > 0) - message += ", i.e. '" + key.slice(0, c) + "' rather than '" + key + "'"; - - throw new Error(message); - } - - return observe.call(this, key, callback, options); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -193,17 +160,15 @@ function _unmount() { var protoDev = { destroy: destroyDev, - get: getDev, - fire: fire, - observe: observeDev, + get, + fire, on: onDev, set: setDev, - teardown: destroyDev, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/dev-warning-missing-data-computed/expected-bundle.js b/test/js/samples/dev-warning-missing-data-computed/expected-bundle.js index caaf43221f..ef60f3ec41 100644 --- a/test/js/samples/dev-warning-missing-data-computed/expected-bundle.js +++ b/test/js/samples/dev-warning-missing-data-computed/expected-bundle.js @@ -66,13 +66,8 @@ function fire(eventName, data) { } } -function getDev(key) { - if (key) console.warn("`let x = component.get('x')` is deprecated. Use `let { x } = component.get()` instead"); - return get.call(this, key); -} - -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -84,34 +79,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - -function observeDev(key, callback, options) { - console.warn("this.observe(key, (newValue, oldValue) => {...}) is deprecated. Use\n\n // runs before DOM updates\n this.on('state', ({ changed, current, previous }) => {...});\n\n // runs after DOM updates\n this.on('update', ...);\n\n...or add the observe method from the svelte-extras package"); - - var c = (key = '' + key).search(/[.[]/); - if (c > -1) { - var message = - 'The first argument to component.observe(...) must be the name of a top-level property'; - if (c > 0) - message += ", i.e. '" + key.slice(0, c) + "' rather than '" + key + "'"; - - throw new Error(message); - } - - return observe.call(this, key, callback, options); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -193,17 +160,15 @@ function _unmount() { var protoDev = { destroy: destroyDev, - get: getDev, - fire: fire, - observe: observeDev, + get, + fire, on: onDev, set: setDev, - teardown: destroyDev, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/do-use-dataset/_actual-bundle-v2.js b/test/js/samples/do-use-dataset/_actual-bundle-v2.js index 37bc15d302..d16e73a487 100644 --- a/test/js/samples/do-use-dataset/_actual-bundle-v2.js +++ b/test/js/samples/do-use-dataset/_actual-bundle-v2.js @@ -55,8 +55,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -68,18 +68,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -138,18 +126,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/do-use-dataset/expected-bundle-v2.js b/test/js/samples/do-use-dataset/expected-bundle-v2.js index 37bc15d302..d16e73a487 100644 --- a/test/js/samples/do-use-dataset/expected-bundle-v2.js +++ b/test/js/samples/do-use-dataset/expected-bundle-v2.js @@ -55,8 +55,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -68,18 +68,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -138,18 +126,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/do-use-dataset/expected-bundle.js b/test/js/samples/do-use-dataset/expected-bundle.js index 37bc15d302..d16e73a487 100644 --- a/test/js/samples/do-use-dataset/expected-bundle.js +++ b/test/js/samples/do-use-dataset/expected-bundle.js @@ -55,8 +55,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -68,18 +68,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -138,18 +126,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/dont-use-dataset-in-legacy/_actual-bundle-v2.js b/test/js/samples/dont-use-dataset-in-legacy/_actual-bundle-v2.js index be43fd0e9b..925c6e692b 100644 --- a/test/js/samples/dont-use-dataset-in-legacy/_actual-bundle-v2.js +++ b/test/js/samples/dont-use-dataset-in-legacy/_actual-bundle-v2.js @@ -59,8 +59,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -72,18 +72,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -142,18 +130,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/dont-use-dataset-in-legacy/expected-bundle-v2.js b/test/js/samples/dont-use-dataset-in-legacy/expected-bundle-v2.js index be43fd0e9b..925c6e692b 100644 --- a/test/js/samples/dont-use-dataset-in-legacy/expected-bundle-v2.js +++ b/test/js/samples/dont-use-dataset-in-legacy/expected-bundle-v2.js @@ -59,8 +59,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -72,18 +72,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -142,18 +130,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/dont-use-dataset-in-legacy/expected-bundle.js b/test/js/samples/dont-use-dataset-in-legacy/expected-bundle.js index be43fd0e9b..925c6e692b 100644 --- a/test/js/samples/dont-use-dataset-in-legacy/expected-bundle.js +++ b/test/js/samples/dont-use-dataset-in-legacy/expected-bundle.js @@ -59,8 +59,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -72,18 +72,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -142,18 +130,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/dont-use-dataset-in-svg/_actual-bundle-v2.js b/test/js/samples/dont-use-dataset-in-svg/_actual-bundle-v2.js index 1092b9ab86..3ad8d8e988 100644 --- a/test/js/samples/dont-use-dataset-in-svg/_actual-bundle-v2.js +++ b/test/js/samples/dont-use-dataset-in-svg/_actual-bundle-v2.js @@ -59,8 +59,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -72,18 +72,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -142,18 +130,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/dont-use-dataset-in-svg/expected-bundle-v2.js b/test/js/samples/dont-use-dataset-in-svg/expected-bundle-v2.js index 1092b9ab86..3ad8d8e988 100644 --- a/test/js/samples/dont-use-dataset-in-svg/expected-bundle-v2.js +++ b/test/js/samples/dont-use-dataset-in-svg/expected-bundle-v2.js @@ -59,8 +59,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -72,18 +72,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -142,18 +130,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/dont-use-dataset-in-svg/expected-bundle.js b/test/js/samples/dont-use-dataset-in-svg/expected-bundle.js index 1092b9ab86..3ad8d8e988 100644 --- a/test/js/samples/dont-use-dataset-in-svg/expected-bundle.js +++ b/test/js/samples/dont-use-dataset-in-svg/expected-bundle.js @@ -59,8 +59,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -72,18 +72,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -142,18 +130,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/each-block-changed-check/_actual-bundle-v2.js b/test/js/samples/each-block-changed-check/_actual-bundle-v2.js index f7d0080cbd..5a2805c669 100644 --- a/test/js/samples/each-block-changed-check/_actual-bundle-v2.js +++ b/test/js/samples/each-block-changed-check/_actual-bundle-v2.js @@ -71,8 +71,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -84,18 +84,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -154,18 +142,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/each-block-changed-check/expected-bundle-v2.js b/test/js/samples/each-block-changed-check/expected-bundle-v2.js index f7d0080cbd..5a2805c669 100644 --- a/test/js/samples/each-block-changed-check/expected-bundle-v2.js +++ b/test/js/samples/each-block-changed-check/expected-bundle-v2.js @@ -71,8 +71,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -84,18 +84,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -154,18 +142,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/each-block-changed-check/expected-bundle.js b/test/js/samples/each-block-changed-check/expected-bundle.js index a3023dc6b1..80b5d1220c 100644 --- a/test/js/samples/each-block-changed-check/expected-bundle.js +++ b/test/js/samples/each-block-changed-check/expected-bundle.js @@ -71,8 +71,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -84,18 +84,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -154,18 +142,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/event-handlers-custom/expected-bundle.js b/test/js/samples/event-handlers-custom/expected-bundle.js index 861a3afc78..977e92dec6 100644 --- a/test/js/samples/event-handlers-custom/expected-bundle.js +++ b/test/js/samples/event-handlers-custom/expected-bundle.js @@ -51,8 +51,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -64,18 +64,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -134,18 +122,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/head-no-whitespace/_actual-bundle-v2.js b/test/js/samples/head-no-whitespace/_actual-bundle-v2.js index e17d8ede61..cb51aacad9 100644 --- a/test/js/samples/head-no-whitespace/_actual-bundle-v2.js +++ b/test/js/samples/head-no-whitespace/_actual-bundle-v2.js @@ -51,8 +51,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -64,18 +64,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -134,18 +122,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/head-no-whitespace/expected-bundle-v2.js b/test/js/samples/head-no-whitespace/expected-bundle-v2.js index e17d8ede61..cb51aacad9 100644 --- a/test/js/samples/head-no-whitespace/expected-bundle-v2.js +++ b/test/js/samples/head-no-whitespace/expected-bundle-v2.js @@ -51,8 +51,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -64,18 +64,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -134,18 +122,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/head-no-whitespace/expected-bundle.js b/test/js/samples/head-no-whitespace/expected-bundle.js index e17d8ede61..cb51aacad9 100644 --- a/test/js/samples/head-no-whitespace/expected-bundle.js +++ b/test/js/samples/head-no-whitespace/expected-bundle.js @@ -51,8 +51,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -64,18 +64,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -134,18 +122,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/if-block-no-update/_actual-bundle-v2.js b/test/js/samples/if-block-no-update/_actual-bundle-v2.js index 5569d332f8..12168d6294 100644 --- a/test/js/samples/if-block-no-update/_actual-bundle-v2.js +++ b/test/js/samples/if-block-no-update/_actual-bundle-v2.js @@ -55,8 +55,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -68,18 +68,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -138,18 +126,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/if-block-no-update/expected-bundle-v2.js b/test/js/samples/if-block-no-update/expected-bundle-v2.js index 5569d332f8..12168d6294 100644 --- a/test/js/samples/if-block-no-update/expected-bundle-v2.js +++ b/test/js/samples/if-block-no-update/expected-bundle-v2.js @@ -55,8 +55,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -68,18 +68,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -138,18 +126,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/if-block-no-update/expected-bundle.js b/test/js/samples/if-block-no-update/expected-bundle.js index c48994fc3b..9f75086f35 100644 --- a/test/js/samples/if-block-no-update/expected-bundle.js +++ b/test/js/samples/if-block-no-update/expected-bundle.js @@ -55,8 +55,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -68,18 +68,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -138,18 +126,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/if-block-simple/_actual-bundle-v2.js b/test/js/samples/if-block-simple/_actual-bundle-v2.js index 336cd0bc5d..76e6919ebd 100644 --- a/test/js/samples/if-block-simple/_actual-bundle-v2.js +++ b/test/js/samples/if-block-simple/_actual-bundle-v2.js @@ -55,8 +55,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -68,18 +68,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -138,18 +126,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/if-block-simple/expected-bundle-v2.js b/test/js/samples/if-block-simple/expected-bundle-v2.js index 336cd0bc5d..76e6919ebd 100644 --- a/test/js/samples/if-block-simple/expected-bundle-v2.js +++ b/test/js/samples/if-block-simple/expected-bundle-v2.js @@ -55,8 +55,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -68,18 +68,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -138,18 +126,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/if-block-simple/expected-bundle.js b/test/js/samples/if-block-simple/expected-bundle.js index 47065fea58..676d6d0d4e 100644 --- a/test/js/samples/if-block-simple/expected-bundle.js +++ b/test/js/samples/if-block-simple/expected-bundle.js @@ -55,8 +55,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -68,18 +68,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -138,18 +126,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/inline-style-optimized-multiple/_actual-bundle-v2.js b/test/js/samples/inline-style-optimized-multiple/_actual-bundle-v2.js index 035b3d9414..f15569295a 100644 --- a/test/js/samples/inline-style-optimized-multiple/_actual-bundle-v2.js +++ b/test/js/samples/inline-style-optimized-multiple/_actual-bundle-v2.js @@ -55,8 +55,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -68,18 +68,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -138,18 +126,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/inline-style-optimized-multiple/expected-bundle-v2.js b/test/js/samples/inline-style-optimized-multiple/expected-bundle-v2.js index 035b3d9414..f15569295a 100644 --- a/test/js/samples/inline-style-optimized-multiple/expected-bundle-v2.js +++ b/test/js/samples/inline-style-optimized-multiple/expected-bundle-v2.js @@ -55,8 +55,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -68,18 +68,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -138,18 +126,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/inline-style-optimized-multiple/expected-bundle.js b/test/js/samples/inline-style-optimized-multiple/expected-bundle.js index 035b3d9414..f15569295a 100644 --- a/test/js/samples/inline-style-optimized-multiple/expected-bundle.js +++ b/test/js/samples/inline-style-optimized-multiple/expected-bundle.js @@ -55,8 +55,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -68,18 +68,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -138,18 +126,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/inline-style-optimized-url/_actual-bundle-v2.js b/test/js/samples/inline-style-optimized-url/_actual-bundle-v2.js index b08091489f..77130c71b3 100644 --- a/test/js/samples/inline-style-optimized-url/_actual-bundle-v2.js +++ b/test/js/samples/inline-style-optimized-url/_actual-bundle-v2.js @@ -55,8 +55,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -68,18 +68,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -138,18 +126,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/inline-style-optimized-url/expected-bundle-v2.js b/test/js/samples/inline-style-optimized-url/expected-bundle-v2.js index b08091489f..77130c71b3 100644 --- a/test/js/samples/inline-style-optimized-url/expected-bundle-v2.js +++ b/test/js/samples/inline-style-optimized-url/expected-bundle-v2.js @@ -55,8 +55,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -68,18 +68,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -138,18 +126,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/inline-style-optimized-url/expected-bundle.js b/test/js/samples/inline-style-optimized-url/expected-bundle.js index b08091489f..77130c71b3 100644 --- a/test/js/samples/inline-style-optimized-url/expected-bundle.js +++ b/test/js/samples/inline-style-optimized-url/expected-bundle.js @@ -55,8 +55,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -68,18 +68,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -138,18 +126,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/inline-style-optimized/_actual-bundle-v2.js b/test/js/samples/inline-style-optimized/_actual-bundle-v2.js index fcd458c356..1f444ef704 100644 --- a/test/js/samples/inline-style-optimized/_actual-bundle-v2.js +++ b/test/js/samples/inline-style-optimized/_actual-bundle-v2.js @@ -55,8 +55,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -68,18 +68,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -138,18 +126,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/inline-style-optimized/expected-bundle-v2.js b/test/js/samples/inline-style-optimized/expected-bundle-v2.js index fcd458c356..1f444ef704 100644 --- a/test/js/samples/inline-style-optimized/expected-bundle-v2.js +++ b/test/js/samples/inline-style-optimized/expected-bundle-v2.js @@ -55,8 +55,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -68,18 +68,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -138,18 +126,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/inline-style-optimized/expected-bundle.js b/test/js/samples/inline-style-optimized/expected-bundle.js index fcd458c356..1f444ef704 100644 --- a/test/js/samples/inline-style-optimized/expected-bundle.js +++ b/test/js/samples/inline-style-optimized/expected-bundle.js @@ -55,8 +55,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -68,18 +68,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -138,18 +126,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/inline-style-unoptimized/_actual-bundle-v2.js b/test/js/samples/inline-style-unoptimized/_actual-bundle-v2.js index f7034d9007..8ce9a079cd 100644 --- a/test/js/samples/inline-style-unoptimized/_actual-bundle-v2.js +++ b/test/js/samples/inline-style-unoptimized/_actual-bundle-v2.js @@ -55,8 +55,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -68,18 +68,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -138,18 +126,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/inline-style-unoptimized/expected-bundle-v2.js b/test/js/samples/inline-style-unoptimized/expected-bundle-v2.js index f7034d9007..8ce9a079cd 100644 --- a/test/js/samples/inline-style-unoptimized/expected-bundle-v2.js +++ b/test/js/samples/inline-style-unoptimized/expected-bundle-v2.js @@ -55,8 +55,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -68,18 +68,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -138,18 +126,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/inline-style-unoptimized/expected-bundle.js b/test/js/samples/inline-style-unoptimized/expected-bundle.js index f7034d9007..8ce9a079cd 100644 --- a/test/js/samples/inline-style-unoptimized/expected-bundle.js +++ b/test/js/samples/inline-style-unoptimized/expected-bundle.js @@ -55,8 +55,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -68,18 +68,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -138,18 +126,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/input-without-blowback-guard/expected-bundle.js b/test/js/samples/input-without-blowback-guard/expected-bundle.js index 4b8909150b..f81413a0fc 100644 --- a/test/js/samples/input-without-blowback-guard/expected-bundle.js +++ b/test/js/samples/input-without-blowback-guard/expected-bundle.js @@ -63,8 +63,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -76,18 +76,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -146,18 +134,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/legacy-default/expected-bundle.js b/test/js/samples/legacy-default/expected-bundle.js index b400d303d7..9c444e4097 100644 --- a/test/js/samples/legacy-default/expected-bundle.js +++ b/test/js/samples/legacy-default/expected-bundle.js @@ -73,8 +73,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -86,18 +86,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -156,18 +144,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/legacy-input-type/expected-bundle.js b/test/js/samples/legacy-input-type/expected-bundle.js index ff4b0b5e2b..67be768773 100644 --- a/test/js/samples/legacy-input-type/expected-bundle.js +++ b/test/js/samples/legacy-input-type/expected-bundle.js @@ -57,8 +57,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -70,18 +70,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -140,18 +128,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/legacy-quote-class/expected-bundle.js b/test/js/samples/legacy-quote-class/expected-bundle.js index fc088bf34a..4c44d15ccb 100644 --- a/test/js/samples/legacy-quote-class/expected-bundle.js +++ b/test/js/samples/legacy-quote-class/expected-bundle.js @@ -74,8 +74,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -87,18 +87,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -157,18 +145,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/media-bindings/expected-bundle.js b/test/js/samples/media-bindings/expected-bundle.js index 7d8c7624ea..2926e5a5a0 100644 --- a/test/js/samples/media-bindings/expected-bundle.js +++ b/test/js/samples/media-bindings/expected-bundle.js @@ -67,8 +67,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -80,18 +80,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -150,18 +138,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/non-imported-component/expected-bundle.js b/test/js/samples/non-imported-component/expected-bundle.js index 06d1b0d4ea..d6991d3b72 100644 --- a/test/js/samples/non-imported-component/expected-bundle.js +++ b/test/js/samples/non-imported-component/expected-bundle.js @@ -53,8 +53,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -66,18 +66,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -136,18 +124,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js b/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js index 4b1a9fc481..de7133b48c 100644 --- a/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js +++ b/test/js/samples/onrender-onteardown-rewritten/expected-bundle.js @@ -39,8 +39,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -52,18 +52,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -122,18 +110,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/setup-method/expected-bundle.js b/test/js/samples/setup-method/expected-bundle.js index 39f5d28c80..8267343f12 100644 --- a/test/js/samples/setup-method/expected-bundle.js +++ b/test/js/samples/setup-method/expected-bundle.js @@ -39,8 +39,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -52,18 +52,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -122,18 +110,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/svg-title/expected-bundle.js b/test/js/samples/svg-title/expected-bundle.js index 804ce01d7c..6d67ee7a1d 100644 --- a/test/js/samples/svg-title/expected-bundle.js +++ b/test/js/samples/svg-title/expected-bundle.js @@ -59,8 +59,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -72,18 +72,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -142,18 +130,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/title/_actual-bundle-v2.js b/test/js/samples/title/_actual-bundle-v2.js index df4a5e2125..cc4b9229c8 100644 --- a/test/js/samples/title/_actual-bundle-v2.js +++ b/test/js/samples/title/_actual-bundle-v2.js @@ -39,8 +39,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -52,18 +52,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -122,18 +110,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/title/expected-bundle-v2.js b/test/js/samples/title/expected-bundle-v2.js index df4a5e2125..cc4b9229c8 100644 --- a/test/js/samples/title/expected-bundle-v2.js +++ b/test/js/samples/title/expected-bundle-v2.js @@ -39,8 +39,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -52,18 +52,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -122,18 +110,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/title/expected-bundle.js b/test/js/samples/title/expected-bundle.js index df4a5e2125..cc4b9229c8 100644 --- a/test/js/samples/title/expected-bundle.js +++ b/test/js/samples/title/expected-bundle.js @@ -39,8 +39,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -52,18 +52,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -122,18 +110,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/use-elements-as-anchors/_actual-bundle-v2.js b/test/js/samples/use-elements-as-anchors/_actual-bundle-v2.js index 5fe8f188a2..26852a5540 100644 --- a/test/js/samples/use-elements-as-anchors/_actual-bundle-v2.js +++ b/test/js/samples/use-elements-as-anchors/_actual-bundle-v2.js @@ -63,8 +63,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -76,18 +76,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -146,18 +134,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/use-elements-as-anchors/expected-bundle-v2.js b/test/js/samples/use-elements-as-anchors/expected-bundle-v2.js index 5fe8f188a2..26852a5540 100644 --- a/test/js/samples/use-elements-as-anchors/expected-bundle-v2.js +++ b/test/js/samples/use-elements-as-anchors/expected-bundle-v2.js @@ -63,8 +63,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -76,18 +76,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -146,18 +134,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/use-elements-as-anchors/expected-bundle.js b/test/js/samples/use-elements-as-anchors/expected-bundle.js index 9ac8ca4ebe..451a9fb9b6 100644 --- a/test/js/samples/use-elements-as-anchors/expected-bundle.js +++ b/test/js/samples/use-elements-as-anchors/expected-bundle.js @@ -63,8 +63,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -76,18 +76,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -146,18 +134,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/window-binding-scroll/_actual-bundle-v2.js b/test/js/samples/window-binding-scroll/_actual-bundle-v2.js index a6afbf9b14..ef796382c4 100644 --- a/test/js/samples/window-binding-scroll/_actual-bundle-v2.js +++ b/test/js/samples/window-binding-scroll/_actual-bundle-v2.js @@ -59,8 +59,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -72,18 +72,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -142,18 +130,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/window-binding-scroll/expected-bundle-v2.js b/test/js/samples/window-binding-scroll/expected-bundle-v2.js index a6afbf9b14..ef796382c4 100644 --- a/test/js/samples/window-binding-scroll/expected-bundle-v2.js +++ b/test/js/samples/window-binding-scroll/expected-bundle-v2.js @@ -59,8 +59,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -72,18 +72,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -142,18 +130,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/js/samples/window-binding-scroll/expected-bundle.js b/test/js/samples/window-binding-scroll/expected-bundle.js index a6afbf9b14..ef796382c4 100644 --- a/test/js/samples/window-binding-scroll/expected-bundle.js +++ b/test/js/samples/window-binding-scroll/expected-bundle.js @@ -59,8 +59,8 @@ function fire(eventName, data) { } } -function get(key) { - return key ? this._state[key] : this._state; +function get() { + return this._state; } function init(component, options) { @@ -72,18 +72,6 @@ function init(component, options) { component.store = component.root.store || options.store; } -function observe(key, callback, options) { - var fn = callback.bind(this); - - if (!options || options.init !== false) { - fn(this.get()[key], undefined); - } - - return this.on(options && options.defer ? 'update' : 'state', function(event) { - if (event.changed[key]) fn(event.current[key], event.previous && event.previous[key]); - }); -} - function on(eventName, handler) { if (eventName === 'teardown') return this.on('destroy', handler); @@ -142,18 +130,16 @@ function _unmount() { } var proto = { - destroy: destroy, - get: get, - fire: fire, - observe: observe, - on: on, - set: set, - teardown: destroy, + destroy, + get, + fire, + on, + set, _recompute: noop, - _set: _set, - _mount: _mount, - _unmount: _unmount, - _differs: _differs + _set, + _mount, + _unmount, + _differs }; /* generated by Svelte vX.Y.Z */ diff --git a/test/runtime/samples/store-observe-dollar/_config.js b/test/runtime/samples/store-onstate-dollar/_config.js similarity index 68% rename from test/runtime/samples/store-observe-dollar/_config.js rename to test/runtime/samples/store-onstate-dollar/_config.js index 1861b937d9..0b638bcd01 100644 --- a/test/runtime/samples/store-observe-dollar/_config.js +++ b/test/runtime/samples/store-onstate-dollar/_config.js @@ -14,12 +14,12 @@ export default { test(assert, component) { const names = []; - component.observe('$name', name => { - names.push(name); + component.on('state', ({ current }) => { + names.push(current.$name); }); store.set({ name: 'everybody' }); - assert.deepEqual(names, ['world', 'everybody']); + assert.deepEqual(names, ['everybody']); } }; \ No newline at end of file diff --git a/test/runtime/samples/store-observe-dollar/main.html b/test/runtime/samples/store-onstate-dollar/main.html similarity index 100% rename from test/runtime/samples/store-observe-dollar/main.html rename to test/runtime/samples/store-onstate-dollar/main.html