Skip to content

Instantly share code, notes, and snippets.

If I have an application that shows the green houses in a city, you load the application and I want to show all the green houses on a map so I do the necessary call and stick the data in my state under houses
state = {
houses: [arrayWithAllTheHouses]
}
now I also want to be able to show houses specific for an owner, imagine the owner has 3 green houses, I was thinking to put in my state:
state = {
houses: [arrayWithAllTheHouses]
selectedUser: {userDataFromTheSelectedUserNothingNested}
selectedUserHouses: [arrayWithAllTheHousesForTheUser]