Allows fragment updates to happen after state updates

Proposed fix for #1520. Provides a starting point for discussion.
pull/1654/head
Jacob Wright 6 years ago
parent f38bdaaadf
commit 2c24c36120

@ -107,7 +107,7 @@ export function set(newState) {
flush(this.root);
}
export function _set(newState) {
export function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -115,9 +115,22 @@ export function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -126,6 +139,7 @@ export function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
export function setDev(newState) {

@ -61,8 +61,9 @@ assign(Store.prototype, {
});
const dependents = this._dependents.slice(); // guard against mutations
for (let i = 0; i < dependents.length; i += 1) {
const dependent = dependents[i];
const options = { skipRender: true };
const empty = {};
const dirtyDependents = dependents.filter(dependent => {
const componentState = {};
let dirty = false;
@ -74,8 +75,12 @@ assign(Store.prototype, {
}
}
if (dirty) dependent.component.set(componentState);
}
if (dirty) {
return dependent.component._set(componentState, options);
}
});
dirtyDependents.forEach(dependent => dependent.component.set(empty));
this.fire('update', {
changed,

@ -135,7 +135,7 @@ define("test", function() { "use strict";
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -143,9 +143,22 @@ define("test", function() { "use strict";
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -154,6 +167,7 @@ define("test", function() { "use strict";
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function _mount(target, anchor) {

@ -135,7 +135,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -143,9 +143,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -154,6 +167,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function _mount(target, anchor) {

@ -156,7 +156,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -164,9 +164,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -175,6 +188,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function _mount(target, anchor) {

@ -161,7 +161,7 @@ function setDev(newState) {
set.call(this, newState);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -169,9 +169,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -180,6 +193,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function _mount(target, anchor) {

@ -137,7 +137,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -145,9 +145,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -156,6 +169,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function _mount(target, anchor) {

@ -1 +1 @@
{"version":3,"file":"Main.js","sources":["../src/Main.html"],"sourcesContent":["<Widget/>\n\n<script>\n\timport Widget from './Widget.html';\n\n\texport default {\n\t\tcomponents: {\n\t\t\tWidget\n\t\t}\n\t};\n</script>"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
{"version":3,"file":"Main.js","sources":["../src/Main.html"],"sourcesContent":["<Widget/>\n\n<script>\n\timport Widget from './Widget.html';\n\n\texport default {\n\t\tcomponents: {\n\t\t\tWidget\n\t\t}\n\t};\n</script>"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}

@ -135,7 +135,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -143,9 +143,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -154,6 +167,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function _mount(target, anchor) {

@ -1 +1 @@
{"version":3,"file":"Widget.js","sources":["../src/Widget.html"],"sourcesContent":["<p>widget</p>"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
{"version":3,"file":"Widget.js","sources":["../src/Widget.html"],"sourcesContent":["<p>widget</p>"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}

@ -137,7 +137,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -145,9 +145,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -156,6 +169,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function _mount(target, anchor) {

@ -135,7 +135,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -143,9 +143,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -154,6 +167,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function _mount(target, anchor) {

@ -137,7 +137,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -145,9 +145,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -156,6 +169,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function _mount(target, anchor) {

@ -135,7 +135,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -143,9 +143,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -154,6 +167,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function _mount(target, anchor) {

@ -1,4 +1,4 @@
/* src/Main.html generated by Svelte vx.y.z */
/* src/Main.html generated by Svelte v2.11.0 */
var Main = (function(answer) { "use strict";
answer = (answer && answer.__esModule) ? answer["default"] : answer;
@ -160,7 +160,7 @@ var Main = (function(answer) { "use strict";
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -168,9 +168,22 @@ var Main = (function(answer) { "use strict";
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -179,6 +192,7 @@ var Main = (function(answer) { "use strict";
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function _mount(target, anchor) {

@ -1,4 +1,4 @@
/* src/Main.html generated by Svelte vx.y.z */
/* src/Main.html generated by Svelte v2.12.0 */
function create_main_fragment(component, ctx) {
var p;
@ -135,7 +135,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -143,9 +143,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -154,6 +167,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function _mount(target, anchor) {
@ -180,4 +194,4 @@ function callAll(fns) {
while (fns && fns.length) fns.shift()();
}
export default Main;
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWFpbi5qcyIsInNvdXJjZXMiOlsiLi4vc3JjL01haW4uaHRtbCJdLCJzb3VyY2VzQ29udGVudCI6WyI8cD5IZWxsbyB3b3JsZCE8L3A+XG5cbjxzY3JpcHQ+XG5cdGV4cG9ydCBkZWZhdWx0IHtcblx0XHRvbnJlbmRlciAoKSB7XG5cdFx0XHRjb25zb2xlLmxvZyggJ2hlcmUnICk7XG5cdFx0fVxuXHR9O1xuPC9zY3JpcHQ+Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7In0=
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWFpbi5qcyIsInNvdXJjZXMiOlsiLi4vc3JjL01haW4uaHRtbCJdLCJzb3VyY2VzQ29udGVudCI6WyI8cD5IZWxsbyB3b3JsZCE8L3A+XG5cbjxzY3JpcHQ+XG5cdGV4cG9ydCBkZWZhdWx0IHtcblx0XHRvbnJlbmRlciAoKSB7XG5cdFx0XHRjb25zb2xlLmxvZyggJ2hlcmUnICk7XG5cdFx0fVxuXHR9O1xuPC9zY3JpcHQ+Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OzsifQ==

@ -135,7 +135,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -143,9 +143,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -154,6 +167,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function _mount(target, anchor) {

@ -1 +1 @@
{"version":3,"file":"Main.js","sources":["../src/Main.html"],"sourcesContent":["<p>Hello world!</p>\n\n<script>\n\texport default {\n\t\tonrender () {\n\t\t\tconsole.log( 'here' );\n\t\t}\n\t};\n</script>"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
{"version":3,"file":"Main.js","sources":["../src/Main.html"],"sourcesContent":["<p>Hello world!</p>\n\n<script>\n\texport default {\n\t\tonrender () {\n\t\t\tconsole.log( 'here' );\n\t\t}\n\t};\n</script>"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}

@ -159,7 +159,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -167,9 +167,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -178,6 +191,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function _mount(target, anchor) {

@ -100,7 +100,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -108,9 +108,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -119,6 +132,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -132,7 +132,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -140,9 +140,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -151,6 +164,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -112,7 +112,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -120,9 +120,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -131,6 +144,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -88,7 +88,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -96,9 +96,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -107,6 +120,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -92,7 +92,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -100,9 +100,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -111,6 +124,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -92,7 +92,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -100,9 +100,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -111,6 +124,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -88,7 +88,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -96,9 +96,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -107,6 +120,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -88,7 +88,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -96,9 +96,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -107,6 +120,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -104,7 +104,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -112,9 +112,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -123,6 +136,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -100,7 +100,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -108,9 +108,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -119,6 +132,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -125,7 +125,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -133,9 +133,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -144,6 +157,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function setDev(newState) {

@ -131,7 +131,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -139,9 +139,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -150,6 +163,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function setDev(newState) {

@ -131,7 +131,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -139,9 +139,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -150,6 +163,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function setDev(newState) {

@ -122,7 +122,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -130,9 +130,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -141,6 +154,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -93,7 +93,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -101,9 +101,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -112,6 +125,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -125,7 +125,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -133,9 +133,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -144,6 +157,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function setDev(newState) {

@ -104,7 +104,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -112,9 +112,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -123,6 +136,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -108,7 +108,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -116,9 +116,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -127,6 +140,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -108,7 +108,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -116,9 +116,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -127,6 +140,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -124,7 +124,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -132,9 +132,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -143,6 +156,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -427,7 +427,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -435,9 +435,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -446,6 +459,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -207,7 +207,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -215,9 +215,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -226,6 +239,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -100,7 +100,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -108,9 +108,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -119,6 +132,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -100,7 +100,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -108,9 +108,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -119,6 +132,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -104,7 +104,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -112,9 +112,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -123,6 +136,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -104,7 +104,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -112,9 +112,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -123,6 +136,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -104,7 +104,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -112,9 +112,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -123,6 +136,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -104,7 +104,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -112,9 +112,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -123,6 +136,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -104,7 +104,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -112,9 +112,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -123,6 +136,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -104,7 +104,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -112,9 +112,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -123,6 +136,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -112,7 +112,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -120,9 +120,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -131,6 +144,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -116,7 +116,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -124,9 +124,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -135,6 +148,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -112,7 +112,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -120,9 +120,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -131,6 +144,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -106,7 +106,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -114,9 +114,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -125,6 +138,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -116,7 +116,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -124,9 +124,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -135,6 +148,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -102,7 +102,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -110,9 +110,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -121,6 +134,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -88,7 +88,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -96,9 +96,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -107,6 +120,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -108,7 +108,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -116,9 +116,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -127,6 +140,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -88,7 +88,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -96,9 +96,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -107,6 +120,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -112,7 +112,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -120,9 +120,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -131,6 +144,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -112,7 +112,7 @@ function set(newState) {
flush(this.root);
}
function _set(newState) {
function _set(newState, options) {
var oldState = this._state,
changed = {},
dirty = false;
@ -120,9 +120,22 @@ function _set(newState) {
for (var key in newState) {
if (this._differs(newState[key], oldState[key])) changed[key] = dirty = true;
}
if (!dirty) return;
if (!dirty && !this._changed) return false;
this._state = assign(assign({}, oldState), newState);
if (options && options.skipRender) {
if (!this._oldState) this._oldState = oldState;
this._changed = assign(changed, this._changed);
return true;
}
if (this._changed) {
oldState = this._oldState;
changed = assign(changed, this._changed),
this._changed = this._oldState = null;
}
this._recompute(changed, this._state);
if (this._bind) this._bind(changed, this._state);
@ -131,6 +144,7 @@ function _set(newState) {
this._fragment.p(changed, this._state);
this.fire("update", { changed: changed, current: this._state, previous: oldState });
}
return true;
}
function callAll(fns) {

@ -0,0 +1,22 @@
import { Store } from '../../../../store.js';
const store = new Store({
selectedIndex: 0,
items: [{ title: 'One' }, { title: 'Two' }]
});
export default {
store,
html: `
<h1>One</h1>
`,
test(assert, component, target, window) {
store.set({ selectedIndex: 2, items: [{ title: 'One' }, { title: 'Two' }, { title: 'Three' }]});
assert.htmlEqual(target.innerHTML, `
<h1>Three</h1>
`);
}
};

@ -0,0 +1,9 @@
<Component index={$selectedIndex}/>
<script>
import Component from './Component.html';
export default {
components: { Component },
};
</script>
Loading…
Cancel
Save