Skip to content

Commit bef674a

Browse files
committed
Add comments per review feedback
1 parent 52fe20d commit bef674a

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/mixins/property-accessors.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ export const PropertyAccessors = dedupingMixin(superClass => {
291291
*/
292292
_definePropertyAccessor(property, readOnly) {
293293
if (legacyNoBatch) {
294+
// Ensure properties are not flushed when adding instance effects
294295
const ready = this.__dataReady;
295296
this.__dataReady = false;
296297
saveAccessorValue(this, property);

lib/mixins/property-effects.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1570,7 +1570,8 @@ export const PropertyEffects = dedupingMixin(superClass => {
15701570
this._flushClients();
15711571
// Capture element data and flush properties one-by one to defeat
15721572
// Polymer 2.x's batched _propertiesChanged scheme; this approximates
1573-
// 1.x's applyConfig
1573+
// 1.x's applyConfig. Data is reset to mimic 1.x behavior of
1574+
// properties incrementally being initialized
15741575
const changedProps = this.__data;
15751576
const notify = this.__dataToNotify;
15761577
this.__data = {};
@@ -1732,7 +1733,9 @@ export const PropertyEffects = dedupingMixin(superClass => {
17321733
// Compute properties
17331734
if (legacyNoBatch) {
17341735
// When not batching, computed effects may re-enter, so capture
1735-
// notifying properties early
1736+
// notifying properties early. Use simple runEffects rather than
1737+
// runComputedEffects since computed effects will run immediately
1738+
// rather than being batched.
17361739
notifyProps = this.__dataToNotify;
17371740
this.__dataToNotify = null;
17381741
runEffects(this, this[TYPES.COMPUTE], changedProps, oldProps, hasPaths);

0 commit comments

Comments
 (0)