Skip to content

Sample State

ChrisCavs edited this page Jul 5, 2018 · 10 revisions

Sample State

{
  entities: {
    users: {
      1: {
        id: 1,
        name: '',
        email: '',
        image_url: '',
        authoredStoryIds: [],
        followedUserIds: [],
        followedUserStoryIds: [],
        followsIds: []
      }
    }

    stories: {
      1: {
        id: 1,
        title: '',
        subtitle: '',
        body: '',
        image_url: '',
        author_id: 1,
        likes: 20
      }
    },
    
    comments: {
      1: {
        id: 1,
        authorId: 2,
        storyId: 1,
        body: ''
      }
    }

    popularStories: []
  },

  UI: {
    loading: true/false,
    currentUser: {
      id: 1,
      name: 'John',

    },
    modalShow: false
  },

  errors: {
    login: ["Incorrect username/password"],
    storyForm: ["Body cannot be left blank"]
  }
}
Clone this wiki locally