How to use the redux-form.reset 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 bpetetot / conference-hall / src / sagas / event / event.saga.js View on Github external
function* createOrUpdateEvent(form, event) {
  try {
    // indicate start submitting form
    yield put(startSubmit(form))
    if (form === 'event-create') {
      // get user id
      const uid = yield select(getUserId)
      // create event into database
      const ref = yield call(eventCrud.create, { ...event, owner: uid })
      // go to event page
      yield put(push(`/organizer/event/${ref.id}`))
      // reset form
      yield put(reset(form))
    } else {
      // update event into database
      yield call(eventCrud.update, event)
      // update event in store
      yield put(eventData.update(event))
    }
    // set form submitted
    yield put(stopSubmit(form))
  } catch (error) {
    yield put(stopSubmit(form, { _error: error.message }))
    throw error
  }
}
github concur / developer.concur.com / app-management / actions / signup.js View on Github external
.then(() => {
        dispatch(signupSuccess());
        hashHistory.push('/login');
        dispatch(reset('signup'));
      })
      .catch(err => dispatch(signupFailure(err.message)));
github bolandrm / rmb_multicopter / js_ui2 / app / saga.js View on Github external
const fetchConfig = function *() {
  while (true) {
    yield take(t.FETCH_CONFIG)
    yield call(serial.send, SerialCodes.REQUEST_CONFIG)
    yield take(t.SERIAL_GOT_CONFIG)
    yield put(resetForm('config'))
  }
}
github webdevstar / React-Ecommerce / src / admin / client / modules / customerGroups / head / index.js View on Github external
onDelete: id => {
			dispatch(deleteGroup(id));
			dispatch(reset('FormCustomerGroup'));
		},
		onCreate: () => {
github bnhansn / sling / web / src / actions / session.js View on Github external
.then((response) => {
      setCurrentUser(dispatch, response);
      dispatch(reset('signup'));
      router.transitionTo('/');
    })
    .catch((error) => {
github freeCodeCamp / league-for-good / client / src / actions / form.js View on Github external
export function openSnackbar(results, dispatch, props) {
	const form = props.form;

	const message = getMessage(props);

	dispatch({ type: OPEN_SNACKBAR, message });

	dispatch(reset(form));
}
github NDLANO / learningpath-frontend / src / learningPath / new / CreateLearningPath.js View on Github external
componentWillUnmount() {
    const { dispatch } = this.props;
    dispatch(reset('create-learning-path'));
  }