Skip to content

Sample State

Micah Jaffe edited this page Dec 7, 2018 · 8 revisions
{
  entities: {
    users: {
      5: {
        id: 5,
        username: "noteman",
        email: "[email protected]",
        notebookIds: [1, 2],
        noteIds: [5, 8, 9],
        tagIds: [100]
      },
      34: {
        id: 34,
        username: "julius",
        email: "[email protected]",
        notebookIds: [90],
        noteIds: [1, 50],
        tagIds: [20, 21, 22]
      }
    }
    notebooks: {
      90: {
        id: 90,
        name: "Important Plans",
        userId: 5,
        noteIds: [1],
        tagIds: [20]
      },
    notes: {
      1: {
        id: 1,
        title: "Attack at dawn",
        body: "One if by land, two if by sea"
        userId: 5,
        notebookId: 90,
        noteTagIds: [101, 34, 70]
      },
    noteTags: {
      101: {
        id: 101,
        noteId: 1,
        tagId: 20
      }
    }
    tags: {
      20: {
        id: 20,
        name: "IMPORTANT",
        noteTagIds: [101, 57]
      },
    }
  },
  ui: {
    loading: true/false
    theme: dark/light (bonus)
    modal: null/deleteNote/encryptNote (bonus)
    fullscreen: true/false
  }
  errors: {
    login: ["Invalid credentials"]
  }
  session: {
    currentUserId: 5
  }
}
Clone this wiki locally