Skip to content

State Shape

Sionar edited this page Mar 7, 2020 · 6 revisions
{
  entities: {
    users: {
      1: {
        id: 1,
        username: "sionar",
        usertag: 1234,          
      },
      2: {
        id: 2,
        username: "ranois",
        usertag: 9876,          
      }
    },

    servers: {
      1: {
        id: 1,
        name: "Tony's discord",
        private: false,
      },
      2: {
        id: 2,
        name: "Cat server",
        private: true,
      },
    },

    serverKeys: {
      1: {
        id: 1,
        serverKey: cFuFmmm,
        serverId: 1,
      },
    },


    subscriptions: {
      11: {
        id: 11,
        userId: 1,
        serverId: 1
      },
      12: {
        id: 12,
        userId: 1,
        serverId: 2
      },
      13: {
        id: 12,
        userId: 2,
        serverId: 1
      }
    },

    channels: {
      2: {
        id: 2,
        name: 'general',
        description: 'discuss about tony here!'
        serverId: 1,
      },
      3: {
        id: 3,
        name: 'hobbies',
        description: 'hobby related discussion only'
        serverId: 1,
      }
      },
      4: {
        id: 4,
        name: 'general',
        description: 'post your cat pics here'
        serverId: 2,
      }
    },

    messages: {
      128: {
        id: 128,
        userId: 1,
        channelId: 2,
        content: 'First message! Hi everyone!',
        edited: false,
        createdAt: Sun, 01 Jan 2012 00:00:00 +0300,
      },

      129: {
        id: 129,
        userId: 2,
        channelId: 3,
        content: 'my favorite hobby is sleeping',
        edited: true,
        createdAt: Mon, 02 Jan 2012 00:00:00 +0300,
      },
    },

    mentions: {
      1: {
        id: 1,
        userId: 1,
        messageId: 3   
      }
    },

    friends: {
      userId: 1,
      friendId: 2,
      status: 'pending'
    },
  },
  ui: {
    loading: true/false
  },
  errors: {
    createAccount: ["Username cannot be blank"],
    session: ["Incorrect username/password combination"],
    serverForm: ["Server name cannot be blank"],
    joinServer: ["Invalid server invite code."]
  },
  session: { id: 25 }
}

Clone this wiki locally