Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { reducer as formReducer } from 'redux-form';
const RESET_ALL_REDUX_FORM = 'reduxform/reduxForm/RESET_ALL_REDUX_FORM';
const reduxForm = formReducer.plugin({
login: (state, action) => { // <------ 'login' is name of form given to reduxForm()
const { INIT_ALL_STATE } = require('ducks/globalActions');
switch (action.type) {
case INIT_ALL_STATE:
case RESET_ALL_REDUX_FORM:
return {
// <----- clear all field
};
default:
return state;
}
},
});
import multireducer from 'multireducer';
export default combineReducers({
routing: routerReducer,
auth,
counter,
multiCounters: multireducer({
counter1: counter,
counter2: counter,
counter3: counter
}),
myNamespace: combineReducers({
someCustomCounter: multireducer(customCounter, 'customCounter'), // <-- catch actions that contain the key
}),
form: formReducer.plugin(loginFormPlugin),
movies
});
return {
...state,
oldpwd: {} // set old password to empty if error
}
}
}
const editPostActionMap = {
"redux-form/CHANGE" ( state, action ) {
return {
...state,
isDirty: true
}
}
}
const reducer = formReducer.plugin({
changePassword: createReducer(actionMap),
editPost: createReducer(editPostActionMap)
})
export default reducer
bar={23}
/>
);
}
}
);
reducer({}, {
type: "ACTION"
});
reducer.plugin({
myForm: (state: any, action: FormAction) => {
if (action.type === actionTypes.CHANGE && action.meta.form === "securitySettings") {
return {
...state,
values: {
...state.values,
downloadLinkAutoPassword: true,
},
};
} else {
return state;
}
}
});
try {
reducers: (app) => {
const plugins = app.get('form_reducer')
return { form: formReducer.plugin(plugins) }
},
hooks: {
import {combineReducers} from 'redux';
import {reducer as formReducer} from 'redux-form';
import {routerStateReducer} from 'redux-router';
import reduxFormReducer from './reduxForm/reducer';
export default combineReducers({
router: routerStateReducer,
form: formReducer.plugin(reduxFormReducer)
});
reducers: (app) => {
const plugins = app.load_dict('form_reducer')
return { form: formReducer.plugin(plugins) }
},
form_fields: default_fields,
const formHack = (state, action) => {
return action.meta && action.meta.form
? formReducer.plugin({
[action.meta.form]: (formState, formAction) => {
return Object.assign(
{},
formState,
formPlugin(formState, formAction)
);
},
})(state, action)
: formReducer(state, action);
};
const rootReducer = combineReducers({
import { reducer as formReducer } from 'redux-form';
import signin from './form/signin';
export default formReducer.plugin({
signin,
});
return {
...state,
values: {
...state.values,
awards: state.values.awards.slice(0, -1)
}
}
default:
return state
}
}
export { form }
export default reducer.plugin({ resume: form })