Skip to content

Sample State

Josh Earlenbaugh edited this page Nov 22, 2017 · 16 revisions
{
  entities: {
    questions: {
      1: {
        id: 1,
        title: "What is the meaning of life?",
        body: "What's this all about anyway?",
        interlocutor_id: 2
      },
      2: {
        id: 2,
        title: "How do I get out of here?",
        body: "Is there anyway out of this place?",
        interlocutor_id: 25
      },
      3: {
        id: 3,
        title: "What's better, chairs or doors?"
        body: "Chairs are great for sitting, but what would we do without doors?",
        interlocutor_id: 25,
      }
    }
    answers: {
      1: {
        id: 1,
        rhetor_id: 34,
        question_id: 3,
        title: "Chairs for sure!",
        body: "I mean, you can literally sit on them."
      }
      2: {
        id: 2,
        rhetor_id: 23,
        question_id: 4,
        title: "Doors are better. Period."
        body: "Without doors, we would either have to knock down walls to get to other rooms, or just walk in 
                blindly. Thus, we would either have too-much privacy or not enough."
      }
     }
     comments: {
       1: {
         id: 1,
         commentor_id: 23,
         answer_id: 2,
         parent_id: null,
         message: "Agreed. Team doors all the way."
         }
      }
      users: {
        11: {
          id: 11,
          username: "phaedrus",
        },
        23: {
          id: 23,
          username: "socr8s",
        },
        25: {
          id: 25,
          username: "plato99",
        }
      }
  },
  ui: {
    loading: true/false
  },
  errors: {
    login: ["Incorrect username/password combination"],
    questionForm: ["Question title cannot be blank"],
  },
  session: {
    id: 123,
    username: "phaedrus",
  }
}

Back to Table of Contents...

Clone this wiki locally