Advertisement
cbigot

Untitled

Feb 18th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import * as React from 'react';
  2. import { connect } from 'react-redux';
  3. import { changeStatus, removeTodo } from '../../actions/TodoActions';
  4. import { TodoImmutable } from '../../entities/Todo';
  5. import { List } from 'immutable';
  6. import {
  7.     List as ListComponent, ListItem, Checkbox, ListItemText,
  8.     ListItemSecondaryAction, IconButton, Card
  9. } from 'material-ui';
  10. import { CodeStatus } from '../../constants/constants';
  11. import DeleteIcon from 'material-ui-icons/Delete';
  12. import './TodoList.css';
  13.  
  14. /**
  15.  * Fonction d'appel des actions Redux
  16.  * @param dispatch :  fonction redux pour notifier le store
  17.  */
  18. const mapDispatchToProps = (dispatch: Function) => {
  19.     return {
  20.         changeStatus: (todo: TodoImmutable) => dispatch(changeStatus(todo)),
  21.         removeTodo: (todo: TodoImmutable) => dispatch(removeTodo(todo))
  22.     };
  23. };
  24.  
  25. /**
  26.  * Fonction pour mapper le store sur les props du composant de liste
  27.  * @param store : la todo-list
  28.  */
  29. const mapStateToProps = (store: List<TodoImmutable>) => {
  30.     return {
  31.         todoList: store
  32.     };
  33. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement