Skip to content

Sample State

lukewhchen edited this page May 8, 2018 · 4 revisions
{ 
entities: {

    users: {

      1: {
        id: 1,
        username: "luke",
        img_url: ""
      },
      2: {
        id: 2,
        username: "mia",
        img_url: ""
      },
      3: {
        id: 3,
        username: "babysister",
        img_url: ""
      },
      4: {
        id: 4,
        username: "babyhater",
        img_url: "https://twitter.com/dailyedge/status/956637829161017347"
      }

    },

    posts: {

      1: {
        id: 1,
        body: "I like babybook !",
        author_id: 1,
        likes: 99,
        current_user_likes: true
      },
      2: {
        id: 2,
        body: "mirror mirror one the wall who is the most cutest baby in the world",
        author_id: 3,
        likes: 45,
        current_user_likes: true
      },
      3: {
        id: 3,
        body: "such annoying baby",
        author_id: 4,
        likes: 2,
        current_user_likes: false
      }

    },

    comments: {

      1: {
        id: 1,
        body: "how adorable baby~~~",
        author_id: 1
      },
      2: {
        id: 2,
        body: "hi there",
        author_id: 4
      }
  
    },

    friendships: { friend_id: [2, 3] }

    },

  ui: {
    loading: true/false
  },

  errors: {
    login: ["Incorrect username/password combination"],
    postForm: ["Post cannot be blank"]
  },

  session: { id: 1 }
}

Clone this wiki locally