git ssb

1+

dinoworm ๐Ÿ› / catstack



Tree: af21ef94947c2173dcf8776b8945d64e93e3402e

Files: af21ef94947c2173dcf8776b8945d64e93e3402e / 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