From 41394624607a791e3c762812e19fe48f9871caab Mon Sep 17 00:00:00 2001 From: teddddd Date: Wed, 5 Jun 2019 11:58:40 -0700 Subject: [PATCH] mostly cosmetic cleanup of state-init code --- lib/component.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/component.js b/lib/component.js index d456e06a..8021c10d 100644 --- a/lib/component.js +++ b/lib/component.js @@ -271,13 +271,13 @@ class Component extends WebComponent { this.$panelParent.$panelChildren.add(this); // share either appState or all of state - Object.assign(this.$panelRoot.appState, this.appState); // flush any queued appState changes - this.appState = this.$panelRoot.appState; - this.isStateShared = this.$panelRoot.isStateShared; + // flush any queued appState changes + this.appState = Object.assign(this.$panelRoot.appState, this.appState); // if child element state is shared, point // state to parent's state object and flush any // queued state changes to the parent state + this.isStateShared = this.$panelRoot.isStateShared; if (this.isStateShared) { this.state = Object.assign(this.$panelRoot.state, this.state); }