Skip to content

Sample State

Wilfred Ruck edited this page Jan 23, 2019 · 6 revisions

Sample State

{
  entities: {
    channels: {
      1: {
        id: 1,
        title: "Birds",
        description: "The wild birds of the safari",
        is_direct: true,
        is_private: false,
        creator_id: 3,
        member_ids: [3, 2],
        message_ids: [2, 7]
      },
      2: {
        id: 2,
        title: "Ouzi",
        description: "A design-first magazine like none other",
        is_direct: false,
        is_private: false,
        creator_id: 1,
        member_ids: [1, 2, 3],
        message_ids: [4, 5, 6]
      },
      3: {
        id: 3,
        title: "Secret Society",
        description: "",
        is_direct: false,
        is_private: true,
        creator_id: 2,
        member_ids: [2, 1],
        message_ids: [1, 3]
      }
    },
    messages: {
      1: {
        id: 1,
        body: "hey, thanks for inviting me to the secret society!",
        author_id: 1,
        channel_id: 3
      },
      2: {
        id: 2,
        body: "Yellow Billed Hornbills are better than Storks...just saying",
        author_id: 2,
        channel_id: 1
      },
      3: {
        id: 3,
        body: "shhh, I think someone's reading our messages...",
        author_id: 2,
        channel_id: 3
      },
      4: {
        id: 4,
        body: "So our first issue has been launched, very proud of it. Does anyone know when we'll launch the next one?",
        author_id: 2,
        channel_id: 2
      },
      5: {
        id: 5,
        body: "Probably by the end of quarter 2, we'd like to launch right before the summer comes around",
        author_id: 1,
        channel_id: 2
      },
      6: {
        id: 6,
        body: "I think the theme will be images of one solid color per section. I'm on board!",
        authorId: 3,
        channel_id: 2
      },
      7: {
        id: 7,
        body: "Flamingoes are the best of them all, period.",
        authorId: 3,
        channel_id: 1
      }
    },
    users: {
      1: {
        id: 1,
        username: "wizard98",
        email: "test@gmail.com",
        avatar: "wizard.jpg",
        channel_ids: [2, 3],
        dm_ids: []
      },
      2: {
        id: 2,
        username: "wild0ne",
        email: "testing123@aol.com",
        avatar: "wildbull.png",
        channel_ids: [1, 2, 3],
        dm_ids: [1]
      },
      3: {
        id: 3,
        username: "johndoe",
        email: "johnny@msn.com",
        avatar: "snake.tif",
        channel_ids: [1, 2],
        dm_ids: [1]
      }
    }
  },
  ui: {
    loading: true/false
  },
  errors: {
    login: ["Incorrect username/password combination"],
    messageForm: ["Message body cannot be blank"],
  },
  session: { currentUserId: 2 }
}

Clone this wiki locally