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

Update heartbeat right away instead of waiting 20 seconds #4

Open
cinnamon-bun opened this issue Jan 22, 2021 · 0 comments
Open

Update heartbeat right away instead of waiting 20 seconds #4

cinnamon-bun opened this issue Jan 22, 2021 · 0 comments
Labels
good first issue Good for newcomers

Comments

@cinnamon-bun
Copy link
Member

https://github.com/earthstar-project/earthstar-status/blob/main/src/App.tsx#L131-L154

The heartbeat writer is in a setInterval which runs every 20 seconds, but it should also run right away when the page is first loaded.

Pull the contents of the setInterval out into a smaller function called writeHeartbeat, and run that function in the setInterval as well as just before it, as the first line inside the useEffect

@cinnamon-bun cinnamon-bun added the good first issue Good for newcomers label Jan 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant