How to use the redux-form.destroy 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 digibib / ls.ext / redef / patron-client / src / frontend / containers / Register.js View on Github external
renderSuccess () {
    // Manually destroy registration forms
    this.props.dispatch(destroy('registrationPartOne'))
    this.props.dispatch(destroy('registrationPartTwo'))
    this.props.dispatch(destroy('registrationPartThree'))

    return (
      <div data-automation-id="registration_success_modal">
        <form>
          <h2></h2>
          <p>
            {this.props.categoryCode === 'REGBARN'
              ? <span data-automation-id="category">
                  <br>
                  <br>
                </span>
              : <span data-automation-id="category">
                  <br>
                  <br></span></p></form></div>
github forest-watcher / forest-watcher / app / redux-modules / feedback.js View on Github external
name: type,
      status: CONSTANTS.status.uploaded
    };

    dispatch({
      type: UPLOAD_FEEDBACK_REQUEST,
      payload: requestPayload,
      meta: {
        offline: {
          effect: { url, body: form, method: 'POST', headers },
          commit: { type: UPLOAD_FEEDBACK_COMMIT, meta: { feedback: commitPayload } },
          rollback: { type: UPLOAD_FEEDBACK_ROLLBACK } // TODO: MARK AS UNSYNC TO TRY AGAIN
        }
      }
    });
    dispatch(destroy(type));
  };
}
github webRunes / WRIO-InternetOS / src / CoreEditor / actions / linkdialog.js View on Github external
export const closeDialog = () => (dispatch) => {
  dispatch({
    type: LINK_DIALOG_CLOSE,
  });
  dispatch(destroy('linkDialog')); // destroy form manually
};
github digibib / ls.ext / redef / patron-client / src / frontend / containers / Register.js View on Github external
renderSuccess () {
    // Manually destroy registration forms
    this.props.dispatch(destroy('registrationPartOne'))
    this.props.dispatch(destroy('registrationPartTwo'))
    this.props.dispatch(destroy('registrationPartThree'))

    return (
      <div data-automation-id="registration_success_modal">
        <form>
          <h2></h2>
          <p>
            {this.props.categoryCode === 'REGBARN'
              ? <span data-automation-id="category">
                  <br>
                  <br>
                </span>
              : <span data-automation-id="category">
                  <br>
                  <br>
                </span>
            }</p></form></div>
github marmelab / react-admin / packages / ra-core / src / sideEffect / recordForm.spec.js View on Github external
it('resets the form when the LOCATION_CHANGE action has no state', () => {
        const saga = handleLocationChange({
            type: LOCATION_CHANGE,
            payload: { pathname: '/comments/create' },
        });

        expect(saga.next().value).toEqual(put(resetForm()));
        expect(saga.next().value).toEqual(put(destroy(REDUX_FORM_NAME)));
    });
github marmelab / react-admin / packages / ra-core / src / sideEffect / recordForm.js View on Github external
export function* handleLocationChange({ payload }) {
    if (payload.state && payload.state.skipFormReset) {
        return;
    }

    if (isEqual(payload, previousLocation)) {
        return;
    }

    previousLocation = payload;

    yield put(resetForm());
    yield put(destroy(REDUX_FORM_NAME));
}
github Twilio-org / phonebank / public / src / actions / campaign.jsx View on Github external
.then((res) => {
    history.goBack();
    dispatch(destroy('CampaignPage'));
    return res;
  })
  .catch((err) => {
github yugabyte / yugabyte-db / managed / ui / src / components / config / OnPrem / OnPremSuccessContainer.js View on Github external
resetConfigForm: () => {
      dispatch(destroy("onPremConfigForm"));
    },
    fetchConfiguredNodeList: (pUUID) => {