Skip to content

Redux State Shape

Christo Grabowski edited this page May 4, 2023 · 8 revisions

Redux State Shape

Session state

session: {
  user: {}
}

Spots state

spots: {
  allSpots: {
    [spotId]: {
      spotData,
    },
  },
  singleSpot: {
    spotData,
    SpotImages: [imagesData],
    Owner: {
      ownerData,
    },
  },
}

Reviews state

reviews: {
  spot: {
    [reviewId]: {
      reviewData,
      User: {
        userData,
      },
      ReviewImages: [imagesData],
    },
    optionalOrderedList: [],
  },
  user: {
    [reviewId]: {
      reviewData,
      User: {
        userData,
      },
      Spot: {
        spotData,
      },
      ReviewImages: [imagesData],
    },
  },
}

Bookings state

bookings: {
  user: {
    [bookingId]: {
      bookingData,
      Spot: {
        spotData,
      },
    },
  },
  spot: {
    [bookingId]: {
      bookingData,
    },
  },
}

Clone this wiki locally