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

multiple onExpire calls when the function is asynchronous #72

Open
HreneanAlin opened this issue Dec 8, 2021 · 2 comments
Open

multiple onExpire calls when the function is asynchronous #72

HreneanAlin opened this issue Dec 8, 2021 · 2 comments

Comments

@HreneanAlin
Copy link

Hi,
It may be something that I do wrong, but if I assign onExpire prop to an async function that handles an API request and receives a response containing a new timestamp that will be passed to the restart function, when the timer expires, the function in called multiple times.
here is a sandbox example https://codesandbox.io/s/cool-wildflower-9v3ft?file=/src/App.js

@focux
Copy link

focux commented May 19, 2023

Hey! I'm having this same issue, did you find a workaround?

@HreneanAlin
Copy link
Author

Hey! I'm having this same issue, did you find a workaround?

Nope, I had to implement the timer from scratch.

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