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

Timer v2: Emit timer value from machine #161

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

lookupdaily
Copy link
Contributor

This is a second attempt at getting the timer working - but emitting it from the state machine rather than managing it from client

Gweaton and others added 4 commits April 10, 2024 11:31
This is currently rendering "15" on the page (for the initial timer
number). We need to decrease it by 1 each second. This is currently
separate from the XState countdown timer, but there might be a way to
read this value in future. This is a first step.

We've spotted a bug where this is currently rendering multiple times,
but we'll solve that soon.
We had to remove this to get the "countdown" switch statement to work,
but maybe there's a way to get it working.
We feel keeping a separate implementation of timer in client and server could be a bit buggy.

This is an investigation into tracking a timer value using state machines:

- Added a timer machine
- invoked machine from round machine on question answered
- log the value in the console when the timer is running.

The timer doesn't currently stop.
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

Successfully merging this pull request may close these issues.

2 participants