fixing up the connect so it actually calls the thunk version of clear

This commit is contained in:
Ken
2019-02-01 10:34:13 -08:00
parent 1b7775d784
commit 73ff9cdea7
5 changed files with 16 additions and 6 deletions

View File

@@ -1,12 +1,11 @@
import { action, GenericActionTypes, GenericAction, GenericActionLookup } from '../redux-utils/action';
import { Dispatch } from 'redux';
import { Store } from '../store';
import uuid from 'uuid/v4';
import * as todosService from '../service/todosService';
let counter = 0;
export const actions = {
add: (label: string) => action('add', { id: String(counter++), label }),
add: (label: string) => action('add', { id: uuid(), label }),
remove: (id: string) => action('remove', { id }),
edit: (id: string, label: string) => action('edit', { id, label }),
complete: (id: string) => action('complete', { id }),

View File

@@ -17,7 +17,7 @@ export function mapDispatchToProps(dispatch: any) {
remove: (id: string) => dispatch(actionsWithService.remove(id)),
complete: (id: string) => dispatch(actionsWithService.complete(id)),
edit: (id: string, label: string) => dispatch(actionsWithService.edit(id, label)),
clear: () => dispatch(actions.clear()),
clear: () => dispatch(actionsWithService.clear()),
setFilter: (filter: FilterTypes) => dispatch(actions.filter(filter))
};
}