Adding compiler option for immutable back in

This will keep existing code smaller and _mostly_ only add size when using the `immutable` compiler option.
pull/1164/head
Jacob Wright 7 years ago
parent 9e877d9da1
commit 405c4f6371

@ -207,8 +207,11 @@ export default function dom(
${options.dev && `this._debugName = '${debugName}';`}
${options.dev && !generator.customElement &&
`if (!options || (!options.target && !options.root)) throw new Error("'target' is a required option");`}
${templateProperties.immutable && `if (!('immutable' in options)) options = assign({ immutable: %immutable }, options);`}
@init(this, options);
${options.immutable && deindent`
if (options.immutable !== undefined ? options.immutable : ${templateProperties.immutable && '%immutable' || 'this.root.options.immutable'}) {
this._differs = @differsImmutable;
}`}
${templateProperties.store && `this.store = %store();`}
${generator.usesRefs && `this.refs = {};`}
this._state = @assign(${initialState.join(', ')});

@ -52,6 +52,7 @@ export interface CompileOptions {
cssOutputFilename?: string;
dev?: boolean;
immutable?: boolean;
shared?: boolean | string;
cascade?: boolean;
hydratable?: boolean;

@ -72,12 +72,11 @@ export function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
export function observe(key, callback, options) {

@ -1,7 +1,7 @@
import { Validator } from '../../';
import { Node } from '../../../interfaces';
export default function tag(validator: Validator, prop: Node) {
export default function immutable(validator: Validator, prop: Node) {
if (prop.value.type !== 'Literal' || typeof prop.value.value !== 'boolean') {
validator.error(
`'immutable' must be a boolean literal`,

@ -55,10 +55,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -98,12 +94,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

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

@ -74,12 +74,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {
@ -208,8 +207,10 @@ function create_main_fragment(state, component) {
}
function SvelteComponent(options) {
if (!('immutable' in options)) options = assign({ immutable: immutable }, options);
init(this, options);
if (options.immutable !== undefined ? options.immutable : immutable) {
this._differs = differsImmutable;
}
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, differsImmutable, init, noop, proto } from "svelte/shared.js";
var Nested = window.Nested;
@ -34,8 +34,10 @@ function create_main_fragment(state, component) {
}
function SvelteComponent(options) {
if (!('immutable' in options)) options = assign({ immutable: immutable }, options);
init(this, options);
if (options.immutable !== undefined ? options.immutable : immutable) {
this._differs = differsImmutable;
}
this._state = assign({}, options.data);
if (!options.root) {

@ -31,10 +31,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -74,12 +70,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

@ -31,10 +31,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -74,12 +70,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

@ -51,10 +51,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -94,12 +90,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

@ -43,10 +43,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -86,12 +82,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

@ -31,10 +31,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -74,12 +70,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

@ -47,10 +47,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -90,12 +86,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

@ -51,10 +51,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -94,12 +90,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

@ -51,10 +51,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -94,12 +90,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

@ -63,10 +63,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -106,12 +102,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

@ -43,10 +43,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -86,12 +82,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

@ -43,10 +43,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -86,12 +82,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

@ -47,10 +47,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -90,12 +86,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

@ -47,10 +47,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -90,12 +86,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

@ -47,10 +47,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -90,12 +86,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

@ -47,10 +47,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -90,12 +86,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

@ -47,10 +47,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -90,12 +86,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

@ -47,10 +47,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -90,12 +86,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

@ -51,10 +51,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -94,12 +90,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

@ -49,10 +49,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -92,12 +88,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

@ -66,10 +66,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -109,12 +105,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

@ -59,10 +59,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -102,12 +98,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

@ -45,10 +45,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -88,12 +84,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

@ -31,10 +31,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -74,12 +70,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

@ -31,10 +31,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -74,12 +70,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

@ -51,10 +51,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -94,12 +90,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

@ -31,10 +31,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -74,12 +70,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

@ -55,10 +55,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -98,12 +94,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

@ -51,10 +51,6 @@ function differs(a, b) {
return a != a ? b == b : a !== b || ((a && typeof a === 'object') || typeof a === 'function');
}
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;
@ -94,12 +90,11 @@ function init(component, options) {
component._observers = { pre: blankObject(), post: blankObject() };
component._handlers = blankObject();
component._bind = options._bind;
component._differs = differs;
component.options = options;
component.root = options.root || component;
component.store = component.root.store || options.store;
var immutable = options.immutable !== undefined ? options.immutable : component.root.options.immutable;
component._differs = immutable ? differsImmutable : differs;
}
function observe(key, callback, options) {

Loading…
Cancel
Save