Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export const changeStatus = (todo: TodoImmutable) => {
- todo = todo.set('status', todo.get('status') === CodeStatus.DONE ? CodeStatus.TODO : CodeStatus.DONE);
- return (dispatch: Function) => {
- // On appelle la fonction de sauvegarde
- return saveTodo(todo).then(response => {
- // On notifie le store Redux
- dispatch({
- type: Action.UPDATE_TODO,
- todo
- });
- });
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement