Skip to content

Sample State

scott062 edited this page Nov 12, 2018 · 9 revisions

Sample State

{
 entities: {
   users: {
     1: {
       id: 1,
       username: michael_scar,
       user_server_ids: [55, 300, 600],
       avatar: image_url_here,
     },
     2: {
       id: 2,
       username: mr_poop,
       user_server_ids: [15, 30, 45],
       avatar: image_url_here,
     },
     3: {
       id: 3,
       username: fire_guy,
       user_server_ids: [1, 3, 7],
       avatar: image_url_here,
     },
   },
   servers: {
     1: {
       id: 1,
       name: nashua_branch,
       server_avatar: image_url_here,
       member_ids: [1, 2, 3],
       channel_ids: [1, 2, 3, 4, 5]
     },
     2: {
       id: 2,
       name: scranton_branch,
       server_avatar: image_url_here,
       member_ids: [1, 2, 3],
       channel_ids: [1, 2, 3, 4, 5]
     },
     3: {
       id: 3,
       name: corporate_ny,
       server_avatar: image_url_here,
       member_ids: [1, 2, 3],
       channel_ids: [1, 2, 3, 4, 5]
     },
   },
   channels: {
     1: {
       id: 1,
       name: accounting,
       message_ids: [1, 2, 3],
     },
     2: {
       id: 2,
       name: sales,
       message_ids: [3, 4, 5],
     },
     3: {
       id: 3,
       name: warehouse,
       message_ids: [6, 7, 8],
     },
   },
   messages: {
     1: {
       id: 1,
       body: "I want people to be afraid of how much they love me.",
       link: "link_url_here",
       user_id: 1,

     },
     2: {
       id: 2,
       body: "Bears, beets, battlestar galactica!",
       link: "link_url_here",
       user_id: 3,
     },
     3: {
       id: 3,
       body: "I understand nothing",
       link: "link_url_here",
       user_id: 2,
     },
     4: {
       id: 4,
       body: "Sorry I annoyed you with my friendship!",
       link: "link_url_here",
       user_id: 3,
     },
     5: {
       id: 5,
       body: "I don't care what they say about me, I just want to eat!",
       link: "link_url_here",
       user_id: 2,
     },
     6: {
       id: 6,
       body: "That's what she said!",
       link: "link_url_here",
       user_id: 1,
     },
   },
 },
 ui: {
   loading: true/false,
 },
 errors: {
   login: ["Invalid username/password"],
 },
 session: {
   currentuser_id: 1,
 }
}

Clone this wiki locally