Skip to content

sample state

idechow edited this page Jan 21, 2020 · 6 revisions
 This is what state might look like on a profile page
{
 entities: {
   users: {
     1: {
       id: 1,
       username: 'handle1',
       fname: 'Jane',
       lname: 'Smith',
       email: 'janesmith@happy.io',
       children: [1, 2],
       custom meals: [36], 
     }
   children: {
     1: {
       id: 1,
       first name: 'tom',
       selected meals: [1, 3, 36...],
       preferences/tag: [1, 3],
       favorites: [3, 36],
      }
     2: {
       id: 2,
       first name: 'Beth',
       selected meals: [1, 5, 3...],
       preferences/tag: [1, 3],
       favorites: [1, 5],
   meals: {
      1: {
        id: 1
        title: featured meal 1,
        tags: [ 1, 3],
        ingredients: [ rice, eggplant, etc],
        instructions: [step1, step2, step3],
        photoUrl: url address,
       }
      3: {
       id: 3
       title: featured meal 3,
       tags: [ 1, 4],
       ingredients: [ rice, carrots, etc],
       instructions: [step1, step2, step3],
       photoUrl: url address,
       }
      5: {
       id: 5
       title: featured meal 5,
       tags: [1],
       ingredients: [ rice, peanut butter, etc],
       instructions: [step1, step2, step3],
       photoUrl: url address,
       }
      36: {
       id: 36
       title: custom meal,
       tags: [1],
       ingredients: [ rice, etc],
       instructions: [step1, step2, step3],
       photoUrl: url address,
       }
     }
  tags: {
       1: {
          id: 1,
          title: Vegetarian,
         }
       3: {
          id: 3,
          title: Chinese,
         }
        4: {
          id: 4,
          title: Healthy,
         }
     }
 }

Clone this wiki locally