mirror of
https://github.com/microsoft/frontend-bootcamp.git
synced 2026-01-26 14:56:42 +08:00
adding a step 9 to call services
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
export const addTodo = (label: string) => ({ type: 'addTodo', label });
|
||||
export const remove = (id: string) => ({ type: 'remove', id });
|
||||
export const complete = (id: string) => ({ type: 'complete', id });
|
||||
export const clear = () => ({ type: 'clear' });
|
||||
export const setFilter = (filter: string) => ({ type: 'setFilter', filter });
|
||||
import uuid from 'uuid/v4';
|
||||
|
||||
export const actions = {
|
||||
addTodo: (label: string) => ({ type: 'addTodo', id: uuid(), label }),
|
||||
remove: (id: string) => ({ type: 'remove', id }),
|
||||
complete: (id: string) => ({ type: 'complete', id }),
|
||||
clear: () => ({ type: 'clear' }),
|
||||
setFilter: (filter: string) => ({ type: 'setFilter', filter })
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user