Skip to content

Sample State

lrharris215 edited this page Mar 17, 2021 · 2 revisions

{
    entities: {
        users: {
            1: {
                id: 1,
                username: "GuestAccount",
               }
            42: {
                id: 42,
                username: "sillykhajiit",
               }
        }
        games: {
            34: {
               id: 34,
                title: "The Elder Scrolls V: Skyrim Special Edition"
                description: "Join the thieves guild and be a stealth archer. There's also a main quest, probably.",
                developer: "Bethesda Game Studeos",
                publisher: "Bethesda Softworks",
                price: 3999,
              }
            12: {
               id: 12,
                title: "Stardew Valley"
                description: "Move out to the quaint countryside and start a farm! Befriend the Junimos to defeat the evil Joja Corp, and maybe find love along the way.",
                developer: "ConcernedApe,
                publisher: "ConcernedApe",
                price: 1499,
              }
                     }
        reviews: {
            3: {
                id: 3,
                game_id: 12,
                author_id: 42,
                title: "Great game!"
                body: "Literally the best game ever. 10/10, would make all my friends buy it and play with me."
               }
            }
    }
    ui: {
        shoppingCart: [game_id: 34]
        // will be stored in local storage.     }
    errors: {
        log-in: ["Invalid username or password. Please try again"],
        reviewForm: ["Review title cannot be blank"]     }
    session: {
      current_user{ id: 42 }     }
}

Clone this wiki locally