Skip to content

Sample State

Ed Herman edited this page Dec 19, 2019 · 9 revisions
{
    entities: {
        users: {
            1: {
                id: 1,
                name: "John",
                email: "[email protected]",
                session_token: "flskjahf9827390hsdhaf89",
                password_digest: "fkjashdkjfh2uiw",
                led_project_ids: [1, 4],
                authored_message_ids: [2, 7],
                authored_comments_ids: [1, 3]
            },
        },
        projects: {
            1: {
                id: 1,
                name: "Operation: 9th birthday",
                description: "This WILL be the best 9th birthday party this kiddo ever has.",
                todo_list_ids: [1, 2, 3, 4],
                message_ids: [1, 2, 3, 4],
                event_ids: [1, 2, 3, 4]
            }
        },
        todo_lists: {
            1: {
                id: 1,
                name: "Plan entertainment",
                details: "",
                todo_ids: [1, 2, 3, 4],
                comment_ids: [2, 3, 4, 9]
            }
        },
        todos: {
            1: {
                id: 1,
                todo_list_id: 1,
                body: "Call potential entertainers",
                notes: "clown, magician, ribbon-dance-instructor",
                complete: false
                comment_ids: [5, 6, 7, 8]
            }
        },
        messages: {
            1: {
                id: 1,
                title: "Potential Downfalls of Entertainers",
                category: "Question",
                project_id: 1,
                body: "Do you think that clowns are scary, magicians are creepy, and ribbon-dancing might be a choking hazard? I'm out of ideas, but maybe these three are TERRIBLE. HALP",
                comment_ids: [1, 10, 11, 12]
            }
        },
        events: {
            1: {
                id: 1,
                name: "My baby's last single digit year begins",
                start: "Sun, 01 Jan 2012 00:00:00 +0300",
                end: "Sun, 01 Jan 2012 23:59:59 +0300",
                notes: "I can't believe it's already here!",
                project_id: 1,
                comment_ids: [13, 14, 15, 16]
            }
        },
        comments: {
            1: {
                id: 1,
                author_id: 1,
                body: "Magicians are NOT creepy!"
            }
        }
    },
    ui: {
        filters: {
            ...
        },
        modal: // defaults to null, resets to a string of element being displayed
    },
    session: {
        currentUser: {
            email: "[email protected]",
            session_token: "fkjsdh2084fakjhasd238"
        }
    },
    errors: {
        session: {
        
        },
        projects: {
        }
    }
}
Clone this wiki locally