How to use the redux-form.getFormValues function in redux-form

To help you get started, we’ve selected a few redux-form examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github diegohaz / redux-form-submit / src / index.js View on Github external
const submit = (config, values) => (dispatch, getState) => {
  const { form, validate, onSubmit, asyncValidate } = config
  let { fields } = config
  const formState = getState().form[form]
  values = values || getFormValues(form)(getState()) || {}

  if (!formState) {
    dispatch(initialize(form, values))
    fields.forEach((field) => {
      dispatch(registerField(form, field, 'Field'))
    })
    values = getFormValues(form)(getState())
  } else if (formState.registeredFields) {
    fields = formState.registeredFields.map((field) => field.name)
  } else {
    throw new Error('You must set fields on redux-form config')
  }

  if (typeof validate === 'function') {
    dispatch(updateSyncErrors(form, validate(values)))
  }

  const props = {
    ...config,
    dispatch,
    startSubmit: () => dispatch(startSubmit(form)),
    stopSubmit: (...args) => dispatch(stopSubmit(form, ...args)),
    setSubmitFailed: (...args) => dispatch(setSubmitFailed(form, ...args)),
github Kujbor / react-redux-form-generator / src / components / ReactReduxFormGeneratorWrapper.jsx View on Github external
const mapStateToFormGeneratorProps = (state, { form: formName }) => ({
	form: formName,
	data: getFormValues(formName)(state)
});
github opennode / waldur-homeport / src / customer / CustomerList.tsx View on Github external
const mapStateToProps = state => ({
  customerListFilter: getFormValues('customerListFilter')(state),
});
github i-novus-llc / n2o-framework / frontend / n2o-framework / src / sagas / actionsImpl.js View on Github external
export function* validate(options) {
  const isTouched = true;
  const state = yield select();
  const validationConfig = yield select(
    makeWidgetValidationSelector(options.validatedWidgetId)
  );
  const values = (yield select(getFormValues(options.validatedWidgetId))) || {};
  const notValid =
    options.validate &&
    (yield call(
      validateField(
        validationConfig,
        options.validatedWidgetId,
        state,
        isTouched
      ),
      values,
      options.dispatch
    ));
  return notValid;
}
github opennode / waldur-homeport / src / ansible / python-management / commonEffects.ts View on Github external
function* copyAndUpdateRequests>(
  requestUuid: string, requestWithOutput: any, config: ManagementEffectsConfig) {
  const virtualEnvsAndRequestsFormData: VirtualEnvAndRequestsContainer = yield select(getFormValues(config.formName));
  const updatedRequestsCopy = virtualEnvsAndRequestsFormData.requests.slice();
  const requestIndex = updatedRequestsCopy.findIndex(request => request.uuid === requestUuid);
  updatedRequestsCopy[requestIndex] = config.requestBuilder(requestWithOutput[0]);
  yield put(change(config.formName, 'requests', updatedRequestsCopy));
}
github service-bot / servicebot / views / components / pages / service-request.jsx View on Github external
function mapStateToProps(state) {
    return {
        options:state.options,
        formJSON: getFormValues(REQUEST_FORM_NAME)(state)
    }
}
github arleighdickerson / y2redux / src / routes / Audio / containers / LoginContainer.js View on Github external
const mapStateToProps = (state) => {
  return {...getFormValues(FORM_NAME)(state)}
}
github Nebo15 / annon.web / app / common / containers / forms / PluginForm / index.js View on Github external
@connect(state => ({
  name: selector(state, 'name'),
  values: getFormValues('plugin-form')(state),
  pluginValues: getFormValues('plugin-settings-form')(state),
}))
export default class PluginForm extends React.Component {
github Nebo15 / annon.web / app / common / containers / forms / ApiForm / index.js View on Github external
@connect(state => ({
  values: getFormValues('api-form')(state),
}))
export default class ApiForm extends React.Component {
github FlowCI / flow-web / src / views / Admin / Notify / form.js View on Github external
function mapStateToProps (state, props) {
  return {
    values: getFormValues(formName)(state)
  }
}
export class EmailSettingForm extends Component {