Skip to content

Detailed Redux State Shape

Me-legna edited this page Jan 13, 2023 · 1 revision
  {
    session: {},
    allServers : {
        byId : {
            "server1" : {
                id : "server1",
                name : "servername",
                owner : "user1",
                image_url : "image url",
                is_private : false,
                is_dm : false,
                capacity : 500000
            },
            "server2" : {
                id : "server2",
                name : "servername",
                owner : "user2",
                image_url : "image url",
                is_private : false,
                is_dm : false,
                capacity : 500000
            }
        },
        allIds : ["server1", "server2"]
    },
    allPrivateServers : {
        byId : {
            "server1" : {
                id : "server1",
                name : "servername",
                owner : "user1",
                image_url : "image url",
                is_private : true,
                is_dm : false,
                capacity : 10,
            },
            "server2" : {
                id : "server2",
                name : "servername",
                owner : "user2",
                image_url : "image url",
                is_private : true,
                is_dm : true,
                capacity : 2,
            }
        },
        allIds : ["server1", "server2"]
    },
    singleServer : {
      "id": 1,
      "name": "Baby SWEs",
      "owner_id": 1,
      "image_url": "image.url",
      "is_private": false,
      "is_dm": false,
      "capacity": 500000,
      "MemberIds": ["member1", "member2"],??
      "ChannelIds": ["channel1","channel2"]??
    },
    channels : {
        byId : {
            "channel1" : {
                id : "channel1",
                name : "channelName",
                server : "server1",
                type : "channelType",
                is_private: bool
            },
            "channel2" : {
                id : "channel2",
                name : "channelName",
                server : "server1",
                type : "channelType",
                is_private: bool
            },
            "channel3" : {
                id : "channel3",
                name : "channelName",
                server : "server1",
                type : "channelType",
                is_private: bool
            },
            "channel4" : {
                id : "channel4",
                name : "channelName",
                server : "server1",
                type : "channelType",
                is_private: bool
            },
            "channel5" : {
                id : "channel5",
                name : "channelName",
                server : "server1",
                type : "channelType",
                is_private: bool
            },
        },
        allIds : ["channel1", "channel2", "channel3", "channel4", "channel5"],
    },
    members : {
       byId : {
           "member1" : {
                "id" : "member1",
                "username" : "memberUsername"
            },
            "member2" : {
                "id" : "member2",
                "username" : "memberUsername"
            },
            "member3" : {
                "id" : "member3",
                "username" : "memberUsername"
            },
          },
         allIds : ["member1","member2","member3"],
    },
    messages : {
        byId : {
            "message1" : {
                id : "message1",
                message: "messageContent",
                user : "user1",
                channel : "channel1"
                is_edited : bool,
                created_at : dateTime,
                User : {
                     "id" : "user1",
                     "username" : "username"
                }
            },
            "message2" : {
                id : "message2",
                message: "messageContent",
                user : "user2",
                channel : "channel1"
                is_edited : bool,
                created_at : dateTime,
                User : {
                     "id" : "user2",
                     "username" : "username"
                }
            },
            "message3" : {
                id : "message3",
                message: "messageContent",
                user : "user3",
                channel : "channel1"
                is_edited : bool,
                created_at : dateTime,
                User : {
                     "id" : "user3",
                     "username" : "username"
                }
            },
        },
        allIds : ["user1", "user2", "user3"]
    }
}

Clone this wiki locally