Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix of props update order, inactive while updating if data changed #222

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions app-route.html
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,6 @@

this._matched = matched.join('/');

// Properties that must be updated atomically.
var propertyUpdates = {};

//this.active
Expand Down Expand Up @@ -318,8 +317,11 @@
}

if (this.setProperties) {
// atomic update
this.setProperties(propertyUpdates, true);
//Update properties in a specific order: data, tail and set inactive during update if data changed
propertyUpdates.hasOwnProperty("data") && this._setPendingPropertyOrPath("data", propertyUpdates.data, true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about setting without notifying all of the properties:

this._setPendingPropertyOrPath("data", propertyUpdates.data, false);

and then call this.notifyPath('data', propertyUpdates.data) but in the correct order after all have been set?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% sure this will work; not sure if it will trigger runEffects

propertyUpdates.hasOwnProperty("tail") && this._setPendingPropertyOrPath("tail", propertyUpdates.tail, true);
propertyUpdates.hasOwnProperty("active") && this._setPendingPropertyOrPath("active", propertyUpdates.active, true);
this._invalidateProperties();
} else {
this.__setMulti(propertyUpdates);
}
Expand Down