mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-01-26 14:56:42 +08:00
fixing up the connect so it actually calls the thunk version of clear
This commit is contained in:
@@ -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 }),
|
||||
|
||||
@@ -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))
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user