git ssb

1+

dinoworm ๐Ÿ› / catstack



Commit 32a09db2ab3d6f75c1b6a5b517afe47aa6ae9502

placeholder reducer

Michael Williams committed on 11/28/2015, 10:40:36 AM
Parent: 376e552507d87635ccb06d830c49e436a1c20c7b

Files changed

app/reducers/index.jschanged
app/reducers/todos.jsadded
app/reducers/index.jsView
@@ -1,3 +1,6 @@
11 const bulk = require('bulk-require')
2+const { combineReducers } = require('redux')
23
3-module.exports = bulk(__dirname, '*.js')
4+module.exports = combineReducers(
5+ bulk(__dirname, '*.js')
6+)
app/reducers/todos.jsView
@@ -1,0 +1,16 @@
1+module.exports = todos
2+
3+function todos (state = {}, action) {
4+ switch (action.type) {
5+ case 'ADD_TODO':
6+ return {
7+ ...state,
8+ todos: {
9+ ...state.todos,
10+ [action.payload.id]: action.payload
11+ }
12+ }
13+ default:
14+ return state
15+ }
16+}

Built with git-ssb-web