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

An async widget example #42

Closed
DoctorRyner opened this issue Mar 23, 2020 · 5 comments
Closed

An async widget example #42

DoctorRyner opened this issue Mar 23, 2020 · 5 comments

Comments

@DoctorRyner
Copy link

For instance, how to modify a counter example the way that it increments itself every second? I'm always ending up resetting time after clicking on inc and dec buttons

@drewolson
Copy link

I put together a quick example that may be what you're looking for. Here's an extension of the button example that automatically increments the button every second while you don't press anything.

https://gist.github.com/drewolson/607c7e742c471400e0e61c5068e0728d

Hope this helps.

@DoctorRyner
Copy link
Author

DoctorRyner commented Apr 10, 2020

Yes, of course, I figured out how to do this much but the problem is:

I'm always ending up resetting time after clicking on inc and dec buttons

And that happens in this example as well

Actually, I ended up creating my own UI library based on researching your code and a couple of other UI libs and this code does exactly what I was asking about in the issue

https://github.com/DoctorRyner/gimel/blob/master/examples/src/Main.purs

But I'm in no position to develop and maintain my own library

If I didn't express my thoughts clearly enough, the issue with https://gist.github.com/drewolson/607c7e742c471400e0e61c5068e0728d is that it interrupts incrementing counter's value if you click on buttons yourself

@ajnsit
Copy link
Member

ajnsit commented Apr 28, 2020

@DoctorRyner This is a good point. I couldn't come up with a quick way to prevent the timer from getting reset on user input. I'll look into this more and will get back to you. I will keep this issue open until then.

@janat08
Copy link

janat08 commented May 28, 2020

?

@ajnsit
Copy link
Member

ajnsit commented Jun 6, 2020

This problem will be solved once Concur allows local state within components.

We are going to track the lifecycle and local state implementation in an umbrella issue - #46. Closing this in favor of that issue.

@ajnsit ajnsit closed this as completed Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants