const commandLineArgs = require('command-line-args');
const optionDefinitions = [
{ name: 'flag1', type: Boolean },
{ name: 'flag2', type: Boolean }
];
const options = commandLineArgs(optionDefinitions);
...
if(options.flag1) {
debugger
}
...
const initialState = {
cats: [],
dogs: [],
hozyiny: []
}
const reducer = (state = initialState, action) => {
switch(action.type) {
case LOAD_ALL_DATA: {
const { cats, dogs, hozyiny } = action.data;
return Object.assign({}, state, { cats, dogs, hozyiny })
}
default:
return state
}
}