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

Return full user with player info #70

Open
turnerhayes opened this issue Oct 2, 2018 · 0 comments
Open

Return full user with player info #70

turnerhayes opened this issue Oct 2, 2018 · 0 comments

Comments

@turnerhayes
Copy link
Owner

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant