tur-nr / polymer-redux

Polymer bindings for Redux.
https://tur-nr.github.io/polymer-redux
MIT License
440 stars 67 forks source link

Fix multiple properties observers are called several times. #108

Closed mkorenko closed 7 years ago

mkorenko commented 7 years ago

Steps to reproduce:

  1. Having two properties in state mapped to two different polymer element properties.
  2. Add multiple properties observer on those properties using "static get observers()" method.
  3. Change both properties in state in one reducer.

Result: multiple observer's callback is called twice, with properties changing one by one. Expected: multiple observer's callback should be called only once with new values.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-9.09%) to 90.909% when pulling 06068cbd5ff4fe60c101afad3a72ef976cb2b255 on mkorenko:fix-observers into 8a86689e601815ed3bf0a5be6fceb3f5cd278de1 on tur-nr:master.

coveralls commented 7 years ago

Coverage Status

Coverage decreased (-9.09%) to 90.909% when pulling 2aac328535152c4d6dad034534bb8bdfdf5149e2 on mkorenko:fix-observers into 8a86689e601815ed3bf0a5be6fceb3f5cd278de1 on tur-nr:master.

tur-nr commented 7 years ago

I think you have just squashed: #41 #105 and #107 👏 🙌 🙏

I have a few changes that fixes the tests and also removes the unnecessary check for readOnly props.

Thank you so much 👍

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 100.0% when pulling 62e607743f01e3a635dfd152b64a9b433c826ebb on mkorenko:fix-observers into 8a86689e601815ed3bf0a5be6fceb3f5cd278de1 on tur-nr:master.

dotellie commented 7 years ago

Wow! This is awesome! Thank you so much! Way less code than my attempt at queuing with promises... Not to mention this actually works. 🤣

I don't know if calling protected methods is necessarily a good thing, but I honestly don't really care much at this point, so long as those bugs are fixed. ♥️

mkorenko commented 6 years ago

@tur-nr @magnonellie you are welcome :blush: