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

Issue with settimeout and setstate #70

Open
vl-ing opened this issue Aug 7, 2015 · 1 comment
Open

Issue with settimeout and setstate #70

vl-ing opened this issue Aug 7, 2015 · 1 comment

Comments

@vl-ing
Copy link

vl-ing commented Aug 7, 2015

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
Copy link
Contributor

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?

yomed added a commit to yomed/marko-widgets that referenced this issue Aug 27, 2015
patrick-steele-idem added a commit that referenced this issue Aug 27, 2015
Add test case for using setState from setTimeout - #70
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants