Skip to content

Commit

Permalink
mostly cosmetic cleanup of state-init code
Browse files Browse the repository at this point in the history
  • Loading branch information
tdumitrescu committed Jun 5, 2019
1 parent f3282e8 commit 4139462
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/component.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 4139462

Please sign in to comment.