marko-js-archive / marko-widgets

[LEGACY] Module to support binding of behavior to rendered UI components rendered on the server or client
http://v3.markojs.com/docs/marko-widgets/
MIT License
141 stars 40 forks source link

Issue with settimeout and setstate #70

Open vl-ing opened 9 years ago

vl-ing commented 9 years ago

When we are invoking setstate with settimeout, rerendering is not happening for later timeouts.

setTimeout(function(){_this.setState('CurrentPrice','state1')}, 0);
        setTimeout(function(){_this.setState('CurrentPrice','state2')}, 100);
        setTimeout(function(){_this.setState('CurrentPrice','state3')}, 1000);
        setTimeout(function(){_this.setState('CurrentPrice','state4')}, 0);

Output state is state4

but expected state is state4, state2, state3

patrick-steele-idem commented 9 years ago

Hi @vidya-lingineni, can you please clarify the issue? I would expect the widget to be rerendered multiple times over the 1s time period with different values for the CurrentPrice state property. Are you saying that it never renders the widget using the values of state1, state2, and state4 and that it goes directly to state4?