Skip to content

Sample State

jas-singh-code edited this page Mar 17, 2021 · 17 revisions
{
  entities: {
    users: {
      7: {
        id: 7,
        lastName: "Wangdu",
        firstName: "Phunsuk",
        email: "WangruP@gmail.com"
      },
      13: {
        id: 13,
        lastName: "Sugrim",
        firstName: "Angelique",
        email: "AngeliqueS@gmail.com"
      }
    },
    posts: {
      1:{
        id: 1,
        message: 'what a lovely day to be on the interweb!',
        posterId: 3,
        imageUrl: 'https://picsum.photos/200/300'
        },
      2:{
        id: 2,
        message: 'why are there only old people on this app! Also, im secretly in love with user 3!',
        posterId: 1,
        imageUrl: 'https://picsum.photos/id/237/200/300'
        },
      3:{
        id: 3,
        message: 'asking for a friend, but whats worse to eat whole? ripe lemon or rotten apple?',
        posterId: 5,
        imageUrl: 'https://picsum.photos/seed/picsum/200/300',
      },
    },
    comments: {
      1: {
        body: "lemons for sure man",
        commenterId: 3,
        postId: 3
      },
      2: {
        body: "you heard of a fridge",
        commenterId: 2,
        postId: 3
      },
      3: {
        body: "why are you asing this again",
        commenterId: 1,
        postId: 3
      }
    },
    likes: {
      1: {
        id: 1,
        likeableId: 3,
        likeableType: 'Post',
        likerId: 7
      },
      2: {
        id: 2,
        likeableId: 4,
        likeableType: 'Comment',
        likerId: 7
      },
    },
    friendRequests: {
      1: {
        id: 1,
        senderId: 7,
        receiverId: 8
       },
     },
    friendships: {
      1: {
        id: 1,
        friend1Id: 7,
        friend2Id: 13
       },
     },
   },
  ui: {
    modal: true/false,
  },
  errors: {
    login: ["Incorrect username and/or password"],
    postForm: ["Post title cannot be blank"],
  },
  session: { currentUserId: 41 }
}
Clone this wiki locally