Export default state with reducer

This commit is contained in:
Josh Johnson 2017-10-08 15:52:54 +01:00
parent 6f5673a6a3
commit 4666e33845
5 changed files with 13 additions and 1195 deletions

View file

@ -7,7 +7,7 @@
"scripts": {
"start": "node server.js",
"lint": "eslint assets/**/*.js",
"test": "nyc mocha --require ./config/test.js --compilers babel-core/register \"./src/**/**/**/**/*.spec.js\"",
"test": "nyc mocha --require ./config/test.js --compilers babel-core/register \"./src/**/**/**/**/*.test.js\"",
"test:watch": "npm run test -- --watch",
"css:watch": "nodemon -e scss -x \"npm run css:build\"",
"css:build": "npm run css:sass -s && npm run css:prefix -s && npm run css:min -s",

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,6 @@
const choices = (state = [], action) => {
export const defaultState = [];
export default function choices(state = defaultState, action) {
switch (action.type) {
case 'ADD_CHOICE': {
/*
@ -100,6 +102,4 @@ const choices = (state = [], action) => {
return state;
}
}
};
export default choices;
}

View file

@ -1,4 +1,6 @@
const groups = (state = [], action) => {
export const defaultState = [];
export default function groups(state = defaultState, action) {
switch (action.type) {
case 'ADD_GROUP': {
return [...state, {
@ -17,6 +19,4 @@ const groups = (state = [], action) => {
return state;
}
}
};
export default groups;
}

View file

@ -1,4 +1,6 @@
const items = (state = [], action) => {
export const defaultState = [];
export default function items(state = defaultState, action) {
switch (action.type) {
case 'ADD_ITEM': {
// Add object to items array
@ -49,6 +51,4 @@ const items = (state = [], action) => {
return state;
}
}
};
export default items;
}