{"size": 622, "ext": "js", "max_stars_repo_path": "src/store/modules/snapshot.js", "max_stars_repo_name": "rohitverma007/gingerbread", "max_stars_repo_stars_event_min_datetime": "2018-12-04T03:39:37.000Z", "max_stars_repo_stars_event_max_datetime": "2019-11-02T15:04:33.000Z", "max_issues_repo_path": "src/store/modules/snapshot.js", "max_issues_repo_name": "rohitverma007/gingerbread", "max_issues_repo_issues_event_min_datetime": "2018-12-11T05:35:15.000Z", "max_issues_repo_issues_event_max_datetime": "2019-04-12T21:39:40.000Z", "max_forks_repo_path": "src/store/modules/snapshot.js", "max_forks_repo_name": "rohitverma007/gingerbread", "max_forks_repo_forks_event_min_datetime": "2018-12-05T00:53:22.000Z", "max_forks_repo_forks_event_max_datetime": "2020-04-21T03:07:31.000Z"}
{"max_stars_count": 14, "max_issues_count": 10, "max_forks_count": 3, "avg_line_length": 20.064516129, "max_line_length": 90, "alphanum_fraction": 0.7090032154}
import Helper from '@/services/utils/helper'

// initial state
const state = {
  snapshotData: null,
  snapshotblockNumberData: null
}

// actions
const actions = {
  async loadFromJsonFile ({ commit }) {
    commit('setSnapshotData', require('../../../static/snapshotData.json'))
  }
}

// mutations
const mutations = {
  setSnapshotData (state, data) {
    const { snapshotData, snapshotblockNumberData } = new Helper().parseSnapshotData(data)
    state.snapshotData = snapshotData
    state.snapshotblockNumberData = snapshotblockNumberData
  }
}

export default {
  namespaced: true,
  state,
  actions,
  mutations
}
