git ssb

1+

dinoworm ๐Ÿ› / catstack



Tree: 8ff89763aa5a55ca923acb5f2228036e30440737

Files: 8ff89763aa5a55ca923acb5f2228036e30440737 / app / reducer.js

661 bytesRaw
1const bulk = require('bulk-require')
2import { combineReducers } from 'redux'
3import { routerReducer } from 'react-router-redux'
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: routerReducer
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