You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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}
The text was updated successfully, but these errors were encountered:
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}
The text was updated successfully, but these errors were encountered: