Skip to content

Sample State

Nikhil Kumar edited this page Jun 19, 2022 · 12 revisions
{  
 entities: {
     users: {
         11: {
         id: 11,
         username: "john smith",
         email: "johnsmith@gmail.com"
      },
      25: {
        id: 25,
        username: "jane tarzan",
      }
    },
    listings: {
      1: {
        id: 1,
        name: "The One",
        bed: 2,
        bath: 15
      },
      2: {
        id: 2,
        name: "32-15 Northern ",
        bed: 15,
        bath: 4,
        agentId: 44
      },
    },
    scheduledShowings: {
        10: {
           id: 10,
           userId: 1,
           listingId: 30,
           agentId: 10,
        }
        4: {
           id: 0,
           userId: 3,
           listingId: 4,
           agentId: 3,
        }
    },
    saves: {
        1: {
           id: 1, 
           userId: 2,
           listingId: 1
        },
    },
  }
  ui: {
    loading: true/false,
    modal: true/false
  },

  errors: {
    userErrors: ["Password must be at least 6 characters long"],
    sessionErrors: ["Username/Password cannot be blank"]
  },

  session: { 
    currentUser: 5 
  },
}

Clone this wiki locally