Skip to content

Redux state shape

Rich Churcher edited this page Sep 23, 2018 · 3 revisions
{

  currentUser: {
    user: {
      id: 12345,
      username: 'Florf',
      age: 8
    },
    error: null,
    pending: false
  },

  currentBox: {
    lunchbox: {
      id: 54321,
      userId: 12345,
      protein: 1111,
      produce: 2222,
      dairy: 3333,
      grains: 4444,
      other: 5555
    },
    error: null,
    pending: false
  },

  foods: {
    produce: [
      { id: 2222, name: 'cabbage', categoryId: 1 } 
    ],
    protein: [],
    dairy: [],
    grains: [],
    other: []
  }
}

Errors can be strings or null. user, lunchbox, and food categories can be null.

Clone this wiki locally