{"size": 938, "ext": "js", "max_stars_repo_path": "src/redux/modules/images.js", "max_stars_repo_name": "arcsin037/RGPP-React", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/redux/modules/images.js", "max_issues_repo_name": "arcsin037/RGPP-React", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/redux/modules/images.js", "max_forks_repo_name": "arcsin037/RGPP-React", "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": 24.6842105263, "max_line_length": 65, "alphanum_fraction": 0.3997867804}
import { List, Map } from 'immutable'

// ------------------------------------
// Constants
// ------------------------------------
export const ADD_IMAGE = 'ADD_IMAGE'

// ------------------------------------
// Models
// ------------------------------------

// ------------------------------------
// Actions
// ------------------------------------
export const addImage = data => ({
  type: ADD_IMAGE,
  payload: data
})
// ------------------------------------
// Action Handlers
// ------------------------------------
const actionHandlers = {
  [ADD_IMAGE]: (state, action) => state.push(Map(action.payload))
}
// ------------------------------------
// Reducer
// ------------------------------------

// initial state
export const initialState = List([])

const reducer = (state = initialState, action) => {
  const handler = actionHandlers[action.type]
  return handler ? handler(state, action) : state
}

export default reducer
