Skip to content
Discussion options

You must be logged in to vote

I think the key point here is that a parameterized view is probably not the right abstraction for this use case.

Instead, I would keep the authoritative game state private and expose the information that a player is allowed to see through a separate public table (or tables), keyed by game_id and player identity.

For example, you could have something along the lines of:

game_state

  • game_id
  • players
  • players_cards
  • ...

game_player_view

  • game_id
  • player_id
  • cards
  • ...

The reducer that modifies the game state would also update game_player_view for the affected players. The client can then subscribe/query by game_id, while the sensitive information never becomes part of a public table containing t…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by homersimpsons
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants