-
Notifications
You must be signed in to change notification settings - Fork 0
react redux state shape
Jason Allen edited this page Jan 22, 2023
·
5 revisions
store = {
session: {
user:{
id,
firstName,
lastName,
email,
username
},
groups: {
allGroups: {
[groupId]: {
id,
organizerId,
name,
about,
type,
private,
city,
state,
createdAt,
updatedAt,
numMembers,
previewImage
},
},
singleGroup: {
id,
organizerId,
name,
about,
type,
private,
city,
state,
createdAt,
updatedAt,
numMembers,
GroupImages: [
{id,
url,
preview
}, ...
],
Organizer: {
id,
firstName,
lastName
},
Venues: [
{
id,
groupId,
address,
city,
state,
lat,
lng
}
],
},
},
events: {
allEvents: {
[eventId]: {
eventData,
Group: {
groupData,
},
Venue: {
venueData,
},
},
},
// In this slice we have much more info about the event than in the allEvents slice.
singleEvent: {
eventData,
Group: {
groupData,
},
// Note that venue here will have more information than venue did in the all events slice. (Refer to your API Docs for more info)
Venue: {
venueData,
},
EventImages: [imagesData],
// These would be extra features, not required for your first 2 CRUD features
Members: [membersData],
Attendees: [attendeeData],
},
},
};