turnerhayes / quintro

Classic marble game in HTML
2 stars 1 forks source link

Return full user with player info #70

Open turnerhayes opened 6 years ago

turnerhayes commented 6 years ago

Right now, whenever we need user information from a player, we need to pass along separate user information with the game or players, because users and players are stored separately in the store. Users should still be stored separately (normalized), but the selectors through which we get game information should return user information with the player, instead of just the user ID.

That is, instead of returning from the selector:

player: {
    color: "blue",
    userID: "12345",
}

we return

player: {
    color: "blue",
    user: {
        id: "1234",
        isMe: true,
        ...
    }
}

This could technically mean passing around larger objects, with duplicated information, but I don't think that's a real problem, and it would make the code much cleaner (we won't need players and playerUsers).