Open etitler opened 6 years ago
something like this on the dashboard.js?
constructor(props){ super(props); this.state = { game: [{ _id: this.uuid(), players: [player1, player2], phase: '0: both players placing ships', }], error: null, }; }
Something like this but using redux. What we're missing in the card is the action creator that use superagent to make an ajax request. This reducer will be passed into the combinedReducers function so have the state constructor isn't necessary
This is our redux reducer for our Dashboard's state. This initially should be an empty array that is populated with objects pulled from the game API. These objects should look like:
{ id: 123, players: [player1, player2], phase: '0: both players placing ships}