{"size": 509, "ext": "js", "max_stars_repo_path": "todolist/src/components/TodoList.js", "max_stars_repo_name": "aenon/egghead_redux", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "todolist/src/components/TodoList.js", "max_issues_repo_name": "aenon/egghead_redux", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "todolist/src/components/TodoList.js", "max_forks_repo_name": "aenon/egghead_redux", "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": 18.1785714286, "max_line_length": 53, "alphanum_fraction": 0.5638506876}
import React from 'react'
import { connect } from 'react-redux'

import { delTodo } from '../actions'
import Todo from './Todo'

const todoList = ({todos, dispatch}) => (
  <div className="todo">
    <ul>
      {todos.map(todo => (
        <Todo
          key={todo.id}
          text={todo.text}
          onDelete={() => dispatch(delTodo(todo.id))}
        />
      ))}
    </ul>
  </div>
)

const mapStateToProps = state => ({
  todos: state.todos
})

export default connect(
  mapStateToProps
)(todoList)
