Skip to content

Commit

Permalink
feat(redux-yolo): export reducers separately from services
Browse files Browse the repository at this point in the history
add compilation of build in
  • Loading branch information
RickEyre committed Jun 3, 2018
1 parent 9095a91 commit 50ca7ac
Show file tree
Hide file tree
Showing 6 changed files with 232 additions and 14 deletions.
1 change: 1 addition & 0 deletions packages/redux-yolo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lib
206 changes: 206 additions & 0 deletions packages/redux-yolo/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 12 additions & 3 deletions packages/redux-yolo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@
"name": "redux-yolo",
"version": "0.0.0",
"description": "YOLO; so why waste your time writing redux boilerplate?",
"main": "index.js",
"main": "lib/index.js",
"scripts": {
"test": "eslint src && jest src"
"clean": "shx rm -rf lib",
"babel": "babel src --out-dir lib --ignore test.js",
"test": "eslint src && jest src",
"build": "npm run clean && npm run babel"
},
"files": [
"src",
"lib"
],
"repository": {
"type": "git",
"url": "git+https:/Lemonpeach/react-redux-yolo.git"
Expand All @@ -23,6 +30,7 @@
"homepage": "https:/Lemonpeach/react-redux-yolo#readme",
"devDependencies": {
"@scotia/eslint-config-scotiabank-base": "^1.3.0",
"babel-cli": "^6.26.0",
"babel-core": "^6.26.3",
"babel-eslint": "^8.2.3",
"babel-plugin-module-resolver": "^3.1.1",
Expand All @@ -32,7 +40,8 @@
"eslint-import-resolver-babel-module": "^4.0.0",
"eslint-plugin-import": "^2.12.0",
"jest": "^23.1.0",
"regenerator-runtime": "^0.11.1"
"regenerator-runtime": "^0.11.1",
"shx": "^0.2.2"
},
"jest": {
"collectCoverage": true,
Expand Down
5 changes: 3 additions & 2 deletions packages/redux-yolo/src/__tests__/index.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import yolo, { ReduxYolo } from '../index';
import yolo from '../index';
import { ReduxYolo } from '../yolo';

describe('index', () => {
describe('yolo', () => {
test('exports a function', () => {
const dispatch = jest.fn();
expect(yolo(dispatch)).toBeInstanceOf(ReduxYolo);
Expand Down
12 changes: 3 additions & 9 deletions packages/redux-yolo/src/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
import { reducer } from './reducers';
import yolo from './yolo';

export class ReduxYolo {
constructor(dispatch) {
this.dispatch = dispatch;
this.reducer = reducer;
}
}

export default dispatch => new ReduxYolo(dispatch);
export default yolo;
export { reducer } from './reducers';
Loading

0 comments on commit 50ca7ac

Please sign in to comment.