git ssb

1+

dinoworm ๐Ÿ› / catstack



Commit a911726b99b0e4c5da2f7dd6d4905059b64b9500

bulk require

Michael Williams committed on 11/28/2015, 8:42:54 AM
Parent: bd151b3444051218586e6db524d1767d208bc086

Files changed

app/services/index.jschanged
app/actions/index.jsadded
app/reducers/index.jsadded
package.jsonchanged
app/services/index.jsView
@@ -1,23 +1,3 @@
1-const fs = require('fs')
2-const { map, filter, invoker, zip } = require('ramda')
3-const { join, basename } = require('path')
1+const bulk = require('bulk-require')
42
5-const serviceCreatorNames = filter(
6- (name) => name !== 'index',
7- map(
8- basename,
9- fs.readdirSync(__dirname)
10- )
11-)
12-
13-const serviceCreators = zip(
14- serviceCreatorNames,
15- map(
16- (name) => {
17- require(join(__dirname, name))
18- },
19- serviceCreatorNames
20- )
21-)
22-
23-module.exports = serviceCreators
3+module.exports = bulk(__dirname, '!(index.js)')
app/actions/index.jsView
@@ -1,0 +1,3 @@
1+const bulk = require('bulk-require')
2+
3+module.exports = bulk(__dirname, '*.js')
app/reducers/index.jsView
@@ -1,0 +1,3 @@
1+const bulk = require('bulk-require')
2+
3+module.exports = bulk(__dirname, '*.js')
package.jsonView
@@ -62,8 +62,10 @@
6262 "babel-plugin-transform-object-rest-spread": "^6.1.18",
6363 "babel-preset-es2015": "^6.1.18",
6464 "babel-preset-react": "^6.1.18",
6565 "babelify": "^7.2.0",
66+ "bulk-require": "^0.2.1",
67+ "bulkify": "^1.1.1",
6668 "evalify": "^1.0.1",
6769 "feathers": "^1.2.0",
6870 "lnfs-cli": "^1.0.1",
6971 "npm-run-all": "^1.3.2",

Built with git-ssb-web