Removes date checks and simplifies NaN checks, adds tests

pull/1164/head
Jacob Wright 7 years ago
parent d2f8e472a5
commit 9a1d87494d

@ -123,7 +123,7 @@ export default function dom(
const condition = `${deps.map(dep => `changed.${dep}`).join(' || ')}`;
const statement = `if (@differs(state.${key}, (state.${key} = %computed-${key}(${deps
const statement = `if (this._differs(state.${key}, (state.${key} = %computed-${key}(${deps
.map(dep => `state.${dep}`)
.join(', ')})))) changed.${key} = true;`;
@ -208,6 +208,7 @@ export default function dom(
${options.dev && !generator.customElement &&
`if (!options || (!options.target && !options.root)) throw new Error("'target' is a required option");`}
@init(this, options);
this._differs = @differs;
${templateProperties.store && `this.store = %store();`}
${generator.usesRefs && `this.refs = {};`}
this._state = @assign(${initialState.join(', ')});

@ -26,25 +26,11 @@ export function destroyDev(detach) {
}
export function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
export function differsImmutable(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b;
return a != a ? b == b : a !== b;
}
export function dispatchObservers(component, group, changed, newState, oldState) {
@ -168,28 +154,7 @@ export function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign({}, oldState, newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
dispatchObservers(this, this._observers.pre, changed, this._state, oldState);
this._fragment.p(changed, this._state);
dispatchObservers(this, this._observers.post, changed, this._state, oldState);
}
}
export function _setImmutable(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (differsImmutable(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;

@ -52,14 +52,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -158,7 +151,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -250,6 +243,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign(data(), options.data);
if (!document.getElementById("svelte-2794052100-style")) add_css();

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createElement, createText, detachNode, init, insertNode, noop, proto, setAttribute } from "svelte/shared.js";
import { appendNode, assign, createElement, createText, detachNode, differs, init, insertNode, noop, proto, setAttribute } from "svelte/shared.js";
function data() {
return { foo: 42 }
@ -51,6 +51,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign(data(), options.data);
if (!document.getElementById("svelte-2794052100-style")) add_css();

@ -28,14 +28,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -134,7 +127,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -208,6 +201,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
if (!options.root) {

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, callAll, init, noop, proto } from "svelte/shared.js";
import { assign, callAll, differs, init, noop, proto } from "svelte/shared.js";
var Nested = window.Nested;
@ -33,6 +33,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
if (!options.root) {

@ -0,0 +1,5 @@
export default {
options: {
immutable: true
}
};

@ -0,0 +1,218 @@
function noop() {}
function assign(target) {
var k,
source,
i = 1,
len = arguments.length;
for (; i < len; i++) {
source = arguments[i];
for (k in source) target[k] = source[k];
}
return target;
}
function blankObject() {
return Object.create(null);
}
function destroy(detach) {
this.destroy = noop;
this.fire('destroy');
this.set = this.get = noop;
if (detach !== false) this._fragment.u();
this._fragment.d();
this._fragment = this._state = null;
}
function differsImmutable(a, b) {
return a != a ? b == b : a !== b;
}
function dispatchObservers(component, group, changed, newState, oldState) {
for (var key in group) {
if (!changed[key]) continue;
var newValue = newState[key];
var oldValue = oldState[key];
var callbacks = group[key];
if (!callbacks) continue;
for (var i = 0; i < callbacks.length; i += 1) {
var callback = callbacks[i];
if (callback.__calling) continue;
callback.__calling = true;
callback.call(component, newValue, oldValue);
callback.__calling = false;
}
}
}
function fire(eventName, data) {
var handlers =
eventName in this._handlers && this._handlers[eventName].slice();
if (!handlers) return;
for (var i = 0; i < handlers.length; i += 1) {
handlers[i].call(this, data);
}
}
function get(key) {
return key ? this._state[key] : this._state;
}
function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
}
function observe(key, callback, options) {
var group = options && options.defer
? this._observers.post
: this._observers.pre;
(group[key] || (group[key] = [])).push(callback);
if (!options || options.init !== false) {
callback.__calling = true;
callback.call(this, this._state[key]);
callback.__calling = false;
}
return {
cancel: function() {
var index = group[key].indexOf(callback);
if (~index) group[key].splice(index, 1);
}
};
}
function on(eventName, handler) {
if (eventName === 'teardown') return this.on('destroy', handler);
var handlers = this._handlers[eventName] || (this._handlers[eventName] = []);
handlers.push(handler);
return {
cancel: function() {
var index = handlers.indexOf(handler);
if (~index) handlers.splice(index, 1);
}
};
}
function set(newState) {
this._set(assign({}, newState));
if (this.root._lock) return;
this.root._lock = true;
callAll(this.root._beforecreate);
callAll(this.root._oncreate);
callAll(this.root._aftercreate);
this.root._lock = false;
}
function _set(newState) {
var oldState = this._state,
changed = {},
dirty = false;
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
this._state = assign({}, oldState, newState);
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
if (this._fragment) {
dispatchObservers(this, this._observers.pre, changed, this._state, oldState);
this._fragment.p(changed, this._state);
dispatchObservers(this, this._observers.post, changed, this._state, oldState);
}
}
function callAll(fns) {
while (fns && fns.length) fns.shift()();
}
function _mount(target, anchor) {
this._fragment.m(target, anchor);
}
function _unmount() {
if (this._fragment) this._fragment.u();
}
var proto = {
destroy: destroy,
get: get,
fire: fire,
observe: observe,
on: on,
set: set,
teardown: destroy,
_recompute: noop,
_set: _set,
_mount: _mount,
_unmount: _unmount
};
/* generated by Svelte vX.Y.Z */
function a(x) {
return x * 2;
}
function b(x) {
return x * 3;
}
function create_main_fragment(state, component) {
return {
c: noop,
m: noop,
p: noop,
u: noop,
d: noop
};
}
function SvelteComponent(options) {
init(this, options);
this._differs = differsImmutable;
this._state = assign({}, options.data);
this._recompute({ x: 1 }, this._state);
this._fragment = create_main_fragment(this._state, this);
if (options.target) {
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
}
}
assign(SvelteComponent.prototype, proto);
SvelteComponent.prototype._recompute = function _recompute(changed, state) {
if (changed.x) {
if (this._differs(state.a, (state.a = a(state.x)))) changed.a = true;
if (this._differs(state.b, (state.b = b(state.x)))) changed.b = true;
}
};
export default SvelteComponent;

@ -0,0 +1,49 @@
/* generated by Svelte vX.Y.Z */
import { assign, differsImmutable, init, noop, proto } from "svelte/shared.js";
function a(x) {
return x * 2;
}
function b(x) {
return x * 3;
}
function create_main_fragment(state, component) {
return {
c: noop,
m: noop,
p: noop,
u: noop,
d: noop
};
}
function SvelteComponent(options) {
init(this, options);
this._differs = differsImmutable;
this._state = assign({}, options.data);
this._recompute({ x: 1 }, this._state);
this._fragment = create_main_fragment(this._state, this);
if (options.target) {
this._fragment.c();
this._fragment.m(options.target, options.anchor || null);
}
}
assign(SvelteComponent.prototype, proto);
SvelteComponent.prototype._recompute = function _recompute(changed, state) {
if (changed.x) {
if (this._differs(state.a, (state.a = a(state.x)))) changed.a = true;
if (this._differs(state.b, (state.b = b(state.x)))) changed.b = true;
}
}
export default SvelteComponent;

@ -0,0 +1,8 @@
<script>
export default {
computed: {
a: x => x * 2,
b: x => x * 3
}
};
</script>

@ -28,14 +28,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -134,7 +127,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -201,6 +194,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._recompute({ x: 1 }, this._state);
@ -216,8 +210,8 @@ assign(SvelteComponent.prototype, proto);
SvelteComponent.prototype._recompute = function _recompute(changed, state) {
if (changed.x) {
if (differs(state.a, (state.a = a(state.x)))) changed.a = true;
if (differs(state.b, (state.b = b(state.x)))) changed.b = true;
if (this._differs(state.a, (state.a = a(state.x)))) changed.a = true;
if (this._differs(state.b, (state.b = b(state.x)))) changed.b = true;
}
};

@ -26,6 +26,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._recompute({ x: 1 }, this._state);
@ -41,8 +42,8 @@ assign(SvelteComponent.prototype, proto);
SvelteComponent.prototype._recompute = function _recompute(changed, state) {
if (changed.x) {
if (differs(state.a, (state.a = a(state.x)))) changed.a = true;
if (differs(state.b, (state.b = b(state.x)))) changed.b = true;
if (this._differs(state.a, (state.a = a(state.x)))) changed.a = true;
if (this._differs(state.b, (state.b = b(state.x)))) changed.b = true;
}
}
export default SvelteComponent;

@ -48,14 +48,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -154,7 +147,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -236,6 +229,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
if (!document.getElementById("svelte-3905933315-style")) add_css();

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createElement, detachNode, init, insertNode, noop, proto, setAttribute } from "svelte/shared.js";
import { appendNode, assign, createElement, detachNode, differs, init, insertNode, noop, proto, setAttribute } from "svelte/shared.js";
function encapsulateStyles(node) {
setAttribute(node, "svelte-3905933315", "");
@ -41,6 +41,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
if (!document.getElementById("svelte-3905933315-style")) add_css();

@ -40,14 +40,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -146,7 +139,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -216,6 +209,7 @@ class SvelteComponent extends HTMLElement {
constructor(options = {}) {
super();
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this.attachShadow({ mode: 'open' });

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
import { assign, createElement, detachNode, differs, init, insertNode, noop, proto } from "svelte/shared.js";
function create_main_fragment(state, component) {
var div;
@ -29,6 +29,7 @@ class SvelteComponent extends HTMLElement {
constructor(options = {}) {
super();
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this.attachShadow({ mode: 'open' });

@ -28,14 +28,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -134,7 +127,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -203,6 +196,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign(data_1(), options.data);
var _oncreate = oncreate.bind(this);

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, callAll, init, noop, proto } from "svelte/shared.js";
import { assign, callAll, differs, init, noop, proto } from "svelte/shared.js";
function data_1() {
return {
@ -28,6 +28,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign(data_1(), options.data);
var _oncreate = oncreate.bind(this);

@ -44,14 +44,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -150,7 +143,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -232,6 +225,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
import { assign, createElement, createText, detachNode, differs, init, insertNode, noop, proto } from "svelte/shared.js";
function create_main_fragment(state, component) {
var div, text, div_1;
@ -41,6 +41,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -48,14 +48,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -154,7 +147,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -236,6 +229,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, createText, detachNode, init, insertNode, noop, proto, setAttribute } from "svelte/shared.js";
import { assign, createElement, createText, detachNode, differs, init, insertNode, noop, proto, setAttribute } from "svelte/shared.js";
function create_main_fragment(state, component) {
var div, text, div_1;
@ -41,6 +41,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -48,14 +48,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -154,7 +147,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -234,6 +227,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createSvgElement, detachNode, init, insertNode, noop, proto, setAttribute } from "svelte/shared.js";
import { appendNode, assign, createSvgElement, detachNode, differs, init, insertNode, noop, proto, setAttribute } from "svelte/shared.js";
function create_main_fragment(state, component) {
var svg, g, g_1;
@ -39,6 +39,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -60,14 +60,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -166,7 +159,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -348,6 +341,7 @@ function create_each_block(state, comments, comment, i, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createElement, createText, destroyEach, detachAfter, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
import { appendNode, assign, createElement, createText, destroyEach, detachAfter, detachNode, differs, init, insertNode, noop, proto } from "svelte/shared.js";
function create_main_fragment(state, component) {
var text, p, text_1;
@ -141,6 +141,7 @@ function create_each_block(state, comments, comment, i, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -40,14 +40,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -146,7 +139,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -233,6 +226,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
import { assign, createElement, detachNode, differs, init, insertNode, noop, proto } from "svelte/shared.js";
function foo( node, callback ) {
// code goes here
@ -46,6 +46,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -40,14 +40,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -146,7 +139,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -223,6 +216,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createElement, detachNode, init, noop, proto } from "svelte/shared.js";
import { appendNode, assign, createElement, detachNode, differs, init, noop, proto } from "svelte/shared.js";
function create_main_fragment(state, component) {
var meta, meta_1;
@ -36,6 +36,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -44,14 +44,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -150,7 +143,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -281,6 +274,7 @@ function select_block_type(state) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, createComment, createElement, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
import { assign, createComment, createElement, detachNode, differs, init, insertNode, noop, proto } from "svelte/shared.js";
function create_main_fragment(state, component) {
var if_block_anchor;
@ -90,6 +90,7 @@ function select_block_type(state) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -44,14 +44,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -150,7 +143,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -257,6 +250,7 @@ function create_if_block(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, createComment, createElement, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
import { assign, createComment, createElement, detachNode, differs, init, insertNode, noop, proto } from "svelte/shared.js";
function create_main_fragment(state, component) {
var if_block_anchor;
@ -66,6 +66,7 @@ function create_if_block(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -44,14 +44,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -150,7 +143,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -230,6 +223,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto, setStyle } from "svelte/shared.js";
import { assign, createElement, detachNode, differs, init, insertNode, noop, proto, setStyle } from "svelte/shared.js";
function create_main_fragment(state, component) {
var div;
@ -39,6 +39,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -44,14 +44,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -150,7 +143,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -225,6 +218,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto, setStyle } from "svelte/shared.js";
import { assign, createElement, detachNode, differs, init, insertNode, noop, proto, setStyle } from "svelte/shared.js";
function create_main_fragment(state, component) {
var div;
@ -34,6 +34,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -44,14 +44,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -150,7 +143,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -225,6 +218,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto, setStyle } from "svelte/shared.js";
import { assign, createElement, detachNode, differs, init, insertNode, noop, proto, setStyle } from "svelte/shared.js";
function create_main_fragment(state, component) {
var div;
@ -34,6 +34,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -44,14 +44,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -150,7 +143,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -236,6 +229,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
import { assign, createElement, createText, detachNode, differs, init, insertNode, noop, proto } from "svelte/shared.js";
function create_main_fragment(state, component) {
var div, text, div_1, div_1_style_value;
@ -45,6 +45,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -48,14 +48,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -154,7 +147,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -236,6 +229,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { addListener, assign, createElement, detachNode, init, insertNode, proto, removeListener } from "svelte/shared.js";
import { addListener, assign, createElement, detachNode, differs, init, insertNode, proto, removeListener } from "svelte/shared.js";
function create_main_fragment(state, component) {
var input;
@ -41,6 +41,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -46,14 +46,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -152,7 +145,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -223,6 +216,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, createElement, detachNode, init, insertNode, noop, proto, setInputType } from "svelte/shared.js";
import { assign, createElement, detachNode, differs, init, insertNode, noop, proto, setInputType } from "svelte/shared.js";
function create_main_fragment(state, component) {
var input;
@ -30,6 +30,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -63,14 +63,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -169,7 +162,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -248,6 +241,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, children, claimElement, createElement, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
import { assign, children, claimElement, createElement, detachNode, differs, init, insertNode, noop, proto } from "svelte/shared.js";
function create_main_fragment(state, component) {
var div;
@ -38,6 +38,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -56,14 +56,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -162,7 +155,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -289,6 +282,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
if (!options.root) {

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { addListener, assign, callAll, createElement, detachNode, init, insertNode, proto, removeListener, timeRangesToArray } from "svelte/shared.js";
import { addListener, assign, callAll, createElement, detachNode, differs, init, insertNode, proto, removeListener, timeRangesToArray } from "svelte/shared.js";
function create_main_fragment(state, component) {
var audio, audio_is_paused = true, audio_updating = false, audio_animationframe;
@ -86,6 +86,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
if (!options.root) {

@ -42,14 +42,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -148,7 +141,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -231,6 +224,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
if (!options.root) {

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, callAll, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
import { assign, callAll, createText, detachNode, differs, init, insertNode, noop, proto } from "svelte/shared.js";
import Imported from 'Imported.html';
@ -45,6 +45,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
if (!options.root) {

@ -28,14 +28,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -134,7 +127,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -197,6 +190,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._handlers.destroy = [ondestroy];

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, callAll, init, noop, proto } from "svelte/shared.js";
import { assign, callAll, differs, init, noop, proto } from "svelte/shared.js";
function oncreate() {};
@ -22,6 +22,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._handlers.destroy = [ondestroy];

@ -28,14 +28,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -134,7 +127,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -209,6 +202,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, init, noop, proto } from "svelte/shared.js";
import { assign, differs, init, noop, proto } from "svelte/shared.js";
var methods = {
foo ( bar ) {
@ -34,6 +34,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -48,14 +48,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -154,7 +147,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -224,6 +217,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createSvgElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
import { appendNode, assign, createSvgElement, createText, detachNode, differs, init, insertNode, noop, proto } from "svelte/shared.js";
function create_main_fragment(state, component) {
var svg, title, text;
@ -29,6 +29,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -28,14 +28,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -134,7 +127,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -200,6 +193,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { assign, init, noop, proto } from "svelte/shared.js";
import { assign, differs, init, noop, proto } from "svelte/shared.js";
function create_main_fragment(state, component) {
var title_value;
@ -25,6 +25,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -52,14 +52,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -158,7 +151,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -447,6 +440,7 @@ function create_if_block_4(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createComment, createElement, createText, detachNode, init, insertNode, noop, proto } from "svelte/shared.js";
import { appendNode, assign, createComment, createElement, createText, detachNode, differs, init, insertNode, noop, proto } from "svelte/shared.js";
function create_main_fragment(state, component) {
var div, text, p, text_2, text_3, text_4, p_1, text_6, text_8, if_block_4_anchor;
@ -248,6 +248,7 @@ function create_if_block_4(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._fragment = create_main_fragment(this._state, this);

@ -48,14 +48,7 @@ function destroy(detach) {
}
function differs(a, b) {
if (a == null || b == null) return a !== b;
if (a.constructor !== b.constructor) return true;
if (a.valueOf && b.valueOf) {
a = a.valueOf();
b = b.valueOf();
}
if (typeof a === 'number' && isNaN(a) && isNaN(b)) return false;
return a !== b || typeof a === 'object' || typeof a === 'function';
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
function dispatchObservers(component, group, changed, newState, oldState) {
@ -154,7 +147,7 @@ function _set(newState) {
dirty = false;
for (var key in newState) {
if (differs(newState[key], oldState[key])) changed[key] = dirty = true;
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
@ -248,6 +241,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._state.y = window.scrollY;

@ -1,5 +1,5 @@
/* generated by Svelte vX.Y.Z */
import { appendNode, assign, createElement, createText, detachNode, init, insertNode, proto } from "svelte/shared.js";
import { appendNode, assign, createElement, createText, detachNode, differs, init, insertNode, proto } from "svelte/shared.js";
function create_main_fragment(state, component) {
var window_updating = false, clear_window_updating = function() { window_updating = false; }, window_updating_timeout, p, text, text_1;
@ -53,6 +53,7 @@ function create_main_fragment(state, component) {
function SvelteComponent(options) {
init(this, options);
this._differs = differs;
this._state = assign({}, options.data);
this._state.y = window.scrollY;

@ -187,4 +187,44 @@ describe('store', () => {
}, /Cyclical dependency detected/);
});
});
describe('immutable', () => {
it('observing state only changes on immutable updates', () => {
let newFoo;
let oldFoo;
let callCount = 0;
let value1 = {};
let value2 = {};
const store = new Store({
foo: value1
}, { immutable: true });
store.observe('foo', (n, o) => {
callCount++;
newFoo = n;
oldFoo = o;
});
assert.equal(callCount, 1);
assert.equal(newFoo, value1);
assert.equal(oldFoo, undefined);
store.set({
foo: value1
});
assert.equal(callCount, 1);
assert.equal(newFoo, value1);
assert.equal(oldFoo, undefined);
store.set({
foo: value2
});
assert.equal(callCount, 2);
assert.equal(newFoo, value2);
assert.equal(oldFoo, value1);
});
});
});

Loading…
Cancel
Save