git ssb

1+

dinoworm ๐Ÿ› / catstack



Tree: 6c495c8b7fdf2fb19251200cd2cd547883d7d533

Files: 6c495c8b7fdf2fb19251200cd2cd547883d7d533 / app / reducer.js

660 bytesRaw
1const bulk = require('bulk-require')
2import { combineReducers } from 'redux'
3import { routeReducer } from 'redux-simple-router'
4import { map, mapValues, assign, camelCase, mapKeys } from 'lodash'
5
6export default combine(assign(
7 mapValues(
8 bulk(__dirname, '*/reducer.js'),
9 (module) => module.reducer.default
10 ),
11 mapValues(
12 bulk(__dirname, '*/reducers/*.js'),
13 (module) => combine(
14 mapValues(
15 module.reducers,
16 m => m.default
17 )
18 )
19 ),
20 {
21 routing: routeReducer
22 }
23))
24
25function combine (reducers) {
26 return combineReducers(
27 mapKeys(
28 reducers,
29 (reducer, name) => camelCase(name)
30 )
31 )
32}
33

Built with git-ssb-web