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: "[email protected]"
      },
      13: {
        id: 13,
        lastname: "Sugrim",
        username: "Angelique",
        email: "[email protected]"
      }
    },
    posts: {
      1:{
        id: 1,
        title: 'hello world',
        message: 'what a lovely day to be on the interweb!',
        poster_id: 3,
        image_url: 'https://picsum.photos/200/300'
        },
      2:{
        id: 2,
        title: 'why does this app only have old ppl!?',
        message: 'why are there only old people on this app! Also, im secretly in love with user 3!',
        poster_id: 1,
        image_url: 'https://picsum.photos/id/237/200/300'
        },
      3:{
        id: 3,
        title: 'whats better? a ripe lemon, or a rotten apple?',
        message: 'asking for a friend, but whats worse to eat whole? ripe lemon or rotten apple?',
        poster_id: 5,
        image_url: 'https://picsum.photos/seed/picsum/200/300',
      },
    },
    comments: {
      1: {
        body: "lemons for sure man",
        commenter_id: 3,
        post_id: 3
      },
      2: {
        body: "you heard of a fridge",
        commenter_id: 2,
        post_id: 3
      },
      3: {
        body: "why are you asing this again",
        commenter_id: 1,
        post_id: 3
      }
    },
    likes: {
      1: {
        id: 1,
        likeable_id: 3,
        likeable_type: 'Post'
      },
      2: {
        id: 2,
        likeable_id: 4,
        likeable_type: 'Comment'
      },
    },
    friendRequests: {
      1: {
        id: 1,
        sender_id: 7,
        receiver_id: 8
       },
     },
    friendships: {
      1: {
        id: 1,
        friend1_id: 7,
        friend2_id: 13
       },
     },
   },
  ui: {
    loading: true/false,
  },
  errors: {
    login: ["Incorrect username and/or password"],
    postForm: ["Post title cannot be blank"],
  },
  session: { currentUserId: 41 }
}

Clone this wiki locally