{"size": 522, "ext": "js", "max_stars_repo_path": "src/web/src/store/members/members.slice.js", "max_stars_repo_name": "iagapie/cards-system", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/web/src/store/members/members.slice.js", "max_issues_repo_name": "iagapie/cards-system", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/web/src/store/members/members.slice.js", "max_forks_repo_name": "iagapie/cards-system", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 20.0769230769, "max_line_length": 62, "alphanum_fraction": 0.6436781609}
import { createSlice } from '@reduxjs/toolkit'

import { toObject } from '@/utils/helpers'

const initialState = {
  members: {},
  loading: false,
}

const membersSlice = createSlice({
  name: 'members',
  initialState,
  reducers: {
    setMembers: (state, { payload }) => {
      state.members = toObject(payload, 'uuid')
    },
    setLoading: (state, { payload }) => {
      state.loading = !!payload
    },
  },
})

export const { setMembers, setLoading } = membersSlice.actions

export default membersSlice.reducer
