Skip to content

Sample State

AlbertgitC edited this page Oct 6, 2019 · 3 revisions
{
  entities: {
    feeds: {
      1: {
        id: 1,
        imgUrl: "https://something1.jpg",
        body: "something about picture1",
        authorId: 11,
        commented: [2]
      },
      2: {
        id: 2,
        imgUrl: "https://something2.jpg",
        body: "another about picture2",
        authorId: 25
        commented: [1, 3],
        liked: [1, 2]
      },
      3: {
        id: 3,
        imgUrl: "https://something3.jpg",
        body: "just random stuff",
        authorId: 11,
        liked: [3]
      }
    },
    users: {
      11: {
        id: 11,
        username: "user01albert",
        email: "user01email@email.com",
        authoredFeeds: [1, 3],
        profilePic: "https://user02picture.jpg",
        followers: [25],
        followed: [25]        
      },
      25: {
        id: 25,
        username: "user02mary",
        email: "user02email@email.com",
        authoredFeeds: [2],
        profilePic: "https://user02picture.jpg",
        followers: [11],
        followed: [11]
      }
    },
    comments: {
      1: {
        id: 1,
        body: "stuff about feed2",
        liked: [4]
      },
      2: {
        id: 2,
        body: "stuff about feed1"
      },
      3: {
        id: 3,
        body: "other stuff about feed2"
      }
    }
    likes: {
      1: {
        likerId: 11,
        feedId: 2
      },
      2: {
        likerId: 25,
        feedId: 2
      },
      3: {
        likerId: 25,
        feedId: 3
      },
      4: {
        likerId: 25,
        commentId: 1
      }
    }
  },
  ui: {
    loading: true/false
  },
  errors: {
    login: ["Incorrect username/password combination"],
    feedForm: ["feed imgUrl cannot be blank"],
  },
  session: { currentUserId: 25 }
}

Clone this wiki locally