no complete all

This commit is contained in:
Ken
2019-01-31 11:28:14 -08:00
parent f2ca4ea884
commit 6da255c206
4 changed files with 2 additions and 4 deletions

View File

@@ -2,7 +2,7 @@ import { Reducer } from 'redux';
import { ActionTypes, TodoAction, TodoActionLookup } from '../actions';
import { Draft, produce } from 'immer';
export type ImmerReducer<T, A = any> = (state: Draft<T>, action: A) => T;
export type ImmerReducer<T, A = any> = (state: Draft<T>, action?: A) => T;
export type HandlerMap<T> = { [actionType in ActionTypes]?: ImmerReducer<T, TodoActionLookup[actionType]> };
function isHandlerFunction<T>(handlerOrMap: HandlerMap<T> | ImmerReducer<T>): handlerOrMap is ImmerReducer<T> {

View File

@@ -24,7 +24,7 @@ export const reducer = combineReducers<Store>({
return draft;
},
clear(draft, action) {
clear(draft) {
Object.keys(draft).forEach(id => {
if (draft[id].completed) {
delete draft[id];