Skip to content

Sample State

maggiecs edited this page Jan 24, 2019 · 6 revisions

#Sample State

{
  entities: {
    posts: {
      1: {
        id: 1,
        body: "Isn't she cute?",
        img_url: "https://images.freeimages.com/images/large-previews/4da/puppy-1371458.jpg",
        authorId: 100,
        likerIds: [101],
        commentIds: [20],
        dateCreated: "January 1, 2019"
      },
      2: {
        id: 2,
        body: "",
        img_url: "https://images.freeimages.com/images/small-previews/464/puppy-1400784.jpg",
        authorId: 101,
        likerIds: [100],
        commentIds: [30],
        dateCreated: "January 2, 2019"
      },
      3: {
        id: 3,
        body: "<333",
        img_url: "https://images.freeimages.com/images/small-previews/411/puppies-1479262.jpg",
        authorId: 101,
        likerIds: [100, 101]
        commentIds: [40],
        dateCreated: "January 3, 2019"
      }
    },
    users: {
      100: {
        id: 100,
        username: "happy_puppy",
        followerIds: [101],
        followingIds: [101],
        postIds: [1],
        commentIds: [30, 40],
      },
      101: {
        id: 101,
        username: "cute_puppy",
        followerIds: [100],
        followingIds: [100],
        postIds: [2, 3],
        commentIds: [20],
      }
    },
    comments: {
        20: {
          id: 20,
          authorId: 101,
          postId: [1],
          body: "What a cute puppy!"
        },
        30: {
          id: 30,
          authorId: 100,
          postId: [2],
          body: "So cute!"
        },
        40: {
          id: 40,
          authorId: 100,
          postId: [3],
          body: "Cutee!"
        },
      }
    },
  ui: {
    loading: true/false
  },
  errors: {
    login: ["Incorrect username/password combination"],
    imageForm: ["No file selected"],
  },
  session: { currentUserId: 100 }

Clone this wiki locally