How to use the @uform/core.FormLifeCycle function in @uform/core

To help you get started, we’ve selected a few @uform/core 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 alibaba / uform / packages / react / src / hooks / useForm.ts View on Github external
})
          if (type === LifeCycleTypes.ON_FORM_INPUT_CHANGE) {
            if (props.onChange) {
              props.onChange(
                isStateModel(payload)
                  ? payload.getState((state: IFormState) => state.values)
                  : {}
              )
            }
          }
          if (broadcast) {
            broadcast.notify({ type, payload })
          }
        }
      ),
      new FormLifeCycle(
        LifeCycleTypes.ON_FORM_WILL_INIT,
        (payload: IModel, form: IForm) => {
          const actions = {
            ...form,
            dispatch: form.notify
          }
          if (broadcast) {
            broadcast.setContext(actions)
          }
          implementActions(actions)
        }
      )
    ],
    onReset: props.onReset,
    onSubmit: props.onSubmit,
    onValidateFailed: props.onValidateFailed