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

Reccomendation for Match State #34

Open
KrishnaKalra opened this issue Jan 6, 2025 · 0 comments
Open

Reccomendation for Match State #34

KrishnaKalra opened this issue Jan 6, 2025 · 0 comments

Comments

@KrishnaKalra
Copy link

KrishnaKalra commented Jan 6, 2025

A basic common for all match state should be created when we hit create route on /matches,when a match id is generated.
It may have properties like
matchState:{
matchId:
createdBy:
....
state:{
\ details of games
}
}

state will contain all the info of match state we we were handling before and will be null initially when match is created.we may fill them when respective route(e.g: /cricket ) is called.
This will help generalizing match state structure for all games and will also reduce code length as we can avoid re writing same code for each game.
updating a match state from a event will also be generalized as we just update current state to new update state via simple instructions:
state={....state,....new event}

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

1 participant