nomanHasan
10/11/2017 - 9:59 AM

2 #todoapp-angular-ngrx

2 #todoapp-angular-ngrx

// ........................

export function TodoReducer(state = defaultState, action: Action) {

    switch (action.type) {
    
      
      case TodoActions.CREATE_TODO: {

            return {
                ...state,
                todos: state.todos.map(t => {
                    if (t._id == action.payload._id) {
                        t.loading = true;
                    }

                    return t
                })
            }
        }
    
    
    }
    
}