Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import * as actions from './actions.js';
- const initialState = {
- -- arg1: undefined,
- -- arg2: undefined
- ++ isHeader: false
- };
- export default (state = initialState, action = {}) => {
- const {type, payload} = action;
- -- if (type === actions.EXAMPLE_ACTION_1) {
- -- return Object.assign({}, state, {});
- -- }
- ++ if (type === actions.TOGGLE_PANEL_HEADER) {
- ++ return Object.assign({}, state, { isHeader: !state.isHeader });
- ++ }
- -- if (type === actions.EXAMPLE_ACTION_2) {
- -- return Object.assign({}, state, {
- -- arg1: payload.arg1
- -- });
- -- }
- -- if (type === actions.EXAMPLE_ACTION_3) {
- -- return Object.assign({}, state, {
- -- arg1: payload.arg1,
- -- arg2: payload.arg2
- -- });
- -- }
- return state;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement