refine icon indicating copy to clipboard operation
refine copied to clipboard

[REFACTOR] useForm hook callbacks and mutations

Open aliemir opened this issue 1 year ago • 1 comments

We'll make some refactoring in @refinedev/core's useForm hook to make the current codebase more readable and clean.

While doing so there will be some changes made to the logic to make it simple and easy to follow both for the users and the maintainers.

Discussed changes is listed below but not might be more to be added;

  • Resolve and reject conditions for the onFinish and being able to await for the mutation in pessimistic mode,
  • onMutationSuccess and onMutationError will be triggered by the response of the mutation regardless of the mutation mode,
  • More thorough tests both unit and e2e,
  • Better integration with the devtools monitor,
  • Simpler auto save logic with no separate submission block,
  • Appropriate values and errors should be provided to the callbacks and promises,
  • Avoiding any hanging promises (e.g. when mutation is errored out and onMutationError is provided).
  • There might be changes required for the extended versions of the useForm hook in integration packages and they will also be addressed in the related PRs.

aliemir avatar Feb 28 '24 16:02 aliemir

Hello, I am new to Github. Can you help me with re-creating the thing you are asking for. It will help me a lot.

userAdityaa avatar Mar 03 '24 12:03 userAdityaa