BattleShipDelta / BattleShip-Web

Front end portion of the BattleShip Delta App.
https://battleship-delta-web.herokuapp.com/
MIT License
0 stars 2 forks source link

games Reducer #30

Open etitler opened 6 years ago

etitler commented 6 years ago

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}

tektechnologies commented 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, }; }

etitler commented 6 years ago

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