Skip to content

Sample State

Andrew Li Dong edited this page Feb 22, 2019 · 1 revision

Sample State

{
  entities: {
    users: {
      1: {
        id: 1,
        name: '',
        image_url: '',
        bio: '',
        authored_stories: []
      }
    },

    stories: {
      1: {
        id: 1,
        title: '',
        subtitle: '',
        image_url: '',
        author_id: 1,
        claps: 20
      }
    },

    comments: {
      1: {
        id: 1,
        authorId: 2,
        storyId: 1,
        body: '',
        claps: 20
      }
    },

    popularStories: {
      100: {
        id: 100,
        title: '',
        subtitle: '',
        image_url: '',
        author_id: 1,
        claps: 20
      }
    }
  },

  UI: {
    loading: true / false,
  },

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

  session: {
    currentUserId: 1
  },

  modal: {
    reveal: 'login' / 'signup'
  }
}
Clone this wiki locally