No Description

user.js 679B

12345678910111213141516
  1. const initialState = {
  2. currentUser: null
  3. }
  4. //Action -an object describing what happened.
  5. //Reducers -calculate the new state based on the old state and the action
  6. //The state is equal to the initial state if no state is passed along to this f (an action is passed along the initial state)
  7. //Remember, our actions will be calling the DB, fetching data, and sending it to our reducer (this f)
  8. //which will then update the state. (Esto va a devolver al user con sus estado, nuevo o igual)
  9. //Esto esta setea'o para recivir info de otros files
  10. export const user = (state = initialState, action) => {
  11. return {
  12. ... state,
  13. currentUser: action.currentUser
  14. }
  15. }