diff --git a/examples/todomvc/reducers/todos.js b/examples/todomvc/reducers/todos.js index 8eca4f3a..d972d145 100644 --- a/examples/todomvc/reducers/todos.js +++ b/examples/todomvc/reducers/todos.js @@ -3,6 +3,7 @@ import { ADD_TODO, DELETE_TODO, EDIT_TODO, COMPLETE_TODO, COMPLETE_ALL, CLEAR_CO const initialState = [{ text: 'Use Redux', completed: false, + modified: new Date(), id: 0 }]; @@ -12,6 +13,7 @@ export default function todos(state = initialState, action) { return [{ id: state.reduce((maxId, todo) => Math.max(todo.id, maxId), -1) + 1, completed: false, + modified: new Date(), text: action.text }, ...state]; @@ -23,21 +25,21 @@ export default function todos(state = initialState, action) { case EDIT_TODO: return state.map(todo => todo.id === action.id ? - Object.assign({}, todo, { text: action.text }) : + Object.assign({}, todo, { text: action.text, modified: new Date() }) : todo ); case COMPLETE_TODO: return state.map(todo => todo.id === action.id ? - Object.assign({}, todo, { completed: !todo.completed }) : + Object.assign({}, todo, { completed: !todo.completed, modified: new Date() }) : todo ); case COMPLETE_ALL: const areAllMarked = state.every(todo => todo.completed); return state.map(todo => Object.assign({}, todo, { - completed: !areAllMarked + completed: !areAllMarked, modified: new Date() })); case CLEAR_COMPLETED: diff --git a/examples/todomvc/store/configureStore.js b/examples/todomvc/store/configureStore.js index b483cf42..bf33bb49 100644 --- a/examples/todomvc/store/configureStore.js +++ b/examples/todomvc/store/configureStore.js @@ -4,7 +4,7 @@ import * as actionCreators from '../actions'; export default function configureStore(preloadedState) { const enhancer = window.__REDUX_DEVTOOLS_EXTENSION__ && - window.__REDUX_DEVTOOLS_EXTENSION__({ actionCreators }); + window.__REDUX_DEVTOOLS_EXTENSION__({ actionCreators, serialize: true }); if (!enhancer) { console.warn('Install Redux DevTools Extension to inspect the app state: ' + 'https://github.com/zalmoxisus/redux-devtools-extension#installation')