Skip to content

Sample State

Jose edited this page Jan 19, 2021 · 3 revisions
{

    entities: {

        users: {
            1: {
                id: 1,
                username: "Luchentio",
            },
            21: {
                id: 21,
                username: "ILikeCats",
            }
        },

        routes: {
            1: {
                id: 1,
                route: "serialized string",
                created: new Date(),
                creator_id: 1,
            },
        },

        friendships: {
            1: [21, 4, ...],
            21: [4, 2, ...]
        }

        comments: {
            34: {
                id: 34,
                body: "Nice route.",
                commenter_id: 21,
                route_id: 2,
                created_at: new Date()
            }
        },

        cheers: {
            56: {
                id: 56,
                cheerer_id: 21,
                route_id: 1 
            }
        }
        
    },

    session: { currentUserId: 21 },

    ui: {
        loading: false,
        modal: SAVE_RUN // required from modal_flags.js
    },

    errors: {
        login: ["Invalid credentials!"],
        createRoute: ["You need to give your route a name!"]
    }

}
Clone this wiki locally