Currently the player-specific page to display stats is using the same hook as the test page which displays all players data. This behavior results in complicated mutation functions that can lead to data loss.
Solution
To mitigate this issue a new hook needs to be created. It's expected to receive the ID of a specific player and return an array in a similar fashion to how useState works.
Internally it should use the base Realtime Hook and promote changes exclusively to the selected player.
Problem
Currently the player-specific page to display stats is using the same hook as the test page which displays all players data. This behavior results in complicated mutation functions that can lead to data loss.
Solution
To mitigate this issue a new hook needs to be created. It's expected to receive the ID of a specific player and return an array in a similar fashion to how
useState
works. Internally it should use the base Realtime Hook and promote changes exclusively to the selected player.