Skip to content

sample state

crgee1 edited this page Jul 2, 2019 · 7 revisions
{
  entities: {
    users: {
      1: {
        id: 1,
        username: "Sonic",
        friends: [2]
      },
      2: {
        id: 1,
        username: "Knuckles",
        friends: [1]
      },
      3: {
        id: 1,
        username: "Tails",
        friends: []
      }
    }, 
    routes: {
        1: {
            id: 1,
            userId: 1,
            distance: 3,
            duration: 00:30,
            elevation: 100,
            name: 'loop run',
            description: 'point a to b'
        },
        2: {
            id: 2,
            userId: 1,
            distance: 2,
            duration: 00:45,
            elevation: 200,
            name: 'straight line',
            description: 'no round trip'
        }
    },
    workouts: {
        1: {
            id: 1,
            userId: 1,
            distance: 7,
            duration: 01:30,
            elevation: 630,
            name: 'loop run',
            workoutType: 'run'
            description: 'gotta go fast'
        },
        2: {
            id: 2,
            userId: 1,
            distance: 10,
            duration: 02:45,
            elevation: 400,
            name: 'tourny',
            workoutType: 'race'
            description: 'gotta go faster'
        }
    },
    comments: {
        1: {
            id: 1,
            userId: 1,
            workoutId: 3,
            body: 'keep it up!'
        },
        2: {
            id: 2,
            userId: 2,
            workoutId: 3,
            body: 'wow!!!'
        },
        3: {
            id: 1,
            userId: 1,
            workoutId: 1,
            body: 'new personal record'
        }
    }
  },
  ui: {
      loading: true/false
  },
  errors: {
      login: ["Incorrect username/password combination"],
      commentForm: ["Comment body cannot be blank"]
  },
  session: { currentUserId: 1 }
}

Clone this wiki locally