{"size": 471, "ext": "js", "max_stars_repo_path": "src/reducers/Canvas.js", "max_stars_repo_name": "marcelotokarnia/playing-with-canvas", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/reducers/Canvas.js", "max_issues_repo_name": "marcelotokarnia/playing-with-canvas", "max_issues_repo_issues_event_min_datetime": "2020-09-03T23:07:01.000Z", "max_issues_repo_issues_event_max_datetime": "2020-09-03T23:07:01.000Z", "max_forks_repo_path": "src/reducers/Canvas.js", "max_forks_repo_name": "marcelotokarnia/playing-with-canvas", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 15.1935483871, "max_line_length": 50, "alphanum_fraction": 0.5796178344}
import { UPDATE_CANVAS } from '../actions/types'

const initialState = {
  points: Array(3),
  reference: 0,
  center: null,
  P3: null,
  area: null,
}

const Canvas = (state = initialState, action) => {
  switch (action.type) {
  case UPDATE_CANVAS: {
    const {
      points, reference, center, P3, area,
    } = action
    return {
      points,
      reference,
      center,
      P3,
      area,
    }
  }
  default:
    return state
  }
}

export default Canvas
