mirror of
https://github.com/Choices-js/Choices.git
synced 2024-06-04 23:12:17 +02:00
Export default state with reducer
This commit is contained in:
parent
6f5673a6a3
commit
4666e33845
|
@ -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
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue