{"size": 533, "ext": "js", "max_stars_repo_path": "client/redux/reducers/activeInstanceKey.js", "max_stars_repo_name": "duanbaihong/Medis", "max_stars_repo_stars_event_min_datetime": "2018-08-17T07:48:06.000Z", "max_stars_repo_stars_event_max_datetime": "2018-08-29T09:13:42.000Z", "max_issues_repo_path": "client/redux/reducers/activeInstanceKey.js", "max_issues_repo_name": "duanbaihong/Medis", "max_issues_repo_issues_event_min_datetime": "2020-11-19T02:59:25.000Z", "max_issues_repo_issues_event_max_datetime": "2020-11-19T02:59:35.000Z", "max_forks_repo_path": "client/redux/reducers/activeInstanceKey.js", "max_forks_repo_name": "duanbaihong/Medis", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 3, "max_issues_count": 5, "max_forks_count": null, "avg_line_length": 21.32, "max_line_length": 68, "alphanum_fraction": 0.722326454}
import {handleActions} from 'Utils'
import {
  createInstance,
  selectInstance,
  moveInstance,
  delInstance
} from 'Redux/actions'

export const defaultInstanceKey = 'FIRST_INSTANCE'

export const activeInstanceKey = handleActions(defaultInstanceKey, {
  [createInstance](state, data) {
    return data.key
  },
  [selectInstance](state, data) {
    return data
  },
  [moveInstance](state, {activeInstanceKey}) {
    return activeInstanceKey
  },
  [delInstance](state, {activeInstanceKey}) {
    return activeInstanceKey
  }
})
