Two observers Polymer -


i have 2 observers , in each observer change value of property of other observer. in case dont want other observer execute. how can change observer execute in change of property outside?

thanks

your best option use local variable stop update.

polymer({     is: 'my-element',     properties: {         myproperty: {             type: string,             observer: '_myobservera'         }     },     observers: [         '_myobserverb(myproperty)'     ],     _myobservera(newvalue) {         if(!this._localupdate) {             //do stuff here         } else {             this._localupdate = false;         }     },     _myobserverb(newvalue) {         this._localupdate = true;         //do stuff here     } }) 

Comments

Popular posts from this blog

xml - Extract substrings with XSLT -

math - "ELO Rating" and how does "TSR Rating" work? -

How can do a tuple comparison in coffeescript similar to that in python? -