Skip to content

Sample State

Andre Souza edited this page Sep 20, 2020 · 6 revisions

Sample State

{
  entities: {
    notes: {
      1: {
        id: 1,
        title: "My first note",
        body: "This is my very first note! :)",
        lastEdit: "Sept 10, 2:44:23 pm",
        authorId: 1,
        notebookId: 1,
        tagIds: []
      },
      2: {
        id: 2,
        title: "Things I learned",
        body: "Ruby, Rails, JavaScript, React, Redux",
        lastEdit: "Sept 1, 5:44:23 am",
        authorId: 1,
        notebookId: 1,
        tagIds: [1,2]
      },
      3: {
        id: 3,
        title: "Random todos",
        body: "1-Wash the car, 2-Do groceries",
        lastEdit: "Sept 20, 10:24:30 am",
        authorId: 1,
        notebookId: 2,
        tagIds: [2,3]
      }
    },
    notebooks: {
      1: {
        id: 1,
        authorId: 1,
        name: "Bootcamp",
        lastEdit: "Sept 10, 2:44:23 pm",
        noteIds: [1,2]
      },
      2: {
        id: 2,
        authorId: 1,
        name: "Other",
        lastEdit: "Sept 20, 10:24:30 am",
        noteIds: [3]
      }
    },
    tags: {
      1: {
        id: 1,
        authorId: 1,
        name: "learning",
        noteIds: [2]
      },
      2: {
        id: 2,
        authorId: 1,
        name: "list",
        noteIds: [2,3]
      },
      3: {
        id: 3,
        authorId: 1,
        name: "important",
        noteIds: [3]
      }
    },
    users: {
      1: {
        id: 1,
        email: "[email protected]",
        firstName: "Some",
        lastName: "User",
        userIcon: "iconUrl"
      }
    }
  },
  ui: {
    loading: true/false,
    modal: {
      active: "login"
      inactive: ["sign up", "create notebook", "tags"]
    }
  },
  errors: {
    login: ["Invalid credentials"],
    signup: ["Must include email", "First name can't be blank"],
    noteFrom: ["Note must have a title"]
  },
  session: { currentUserId: 1 }
}
Clone this wiki locally