Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove additional fetchError prop from hook return object #262

Merged
merged 1 commit into from
Sep 8, 2024

Conversation

TheEdoRan
Copy link
Owner

@TheEdoRan TheEdoRan commented Sep 8, 2024

Code in this PR removes the fetchError prop from hook return object. Now the returned object is of type SafeActionResult. This means that if an error gets thrown inside an action, and the handleServerError init option rethrows it instead of setting the serverError prop, now the execute/executeAsync functions will throw it too inside the component, so the handling is managed by the user. This is the same behavior as directly calling a throwable safe action inside the component.

This commit removes the `fetchError` prop from hook return object. Now the returned object is of
type `SafeActionResult`. If an error gets thrown inside an action, and the `handleServerError` init
option rethrows it, now the `execute`/`executeAsync` functions throw it inside the component, so the
handling is up to the user.
Copy link

vercel bot commented Sep 8, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
next-safe-action-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 8, 2024 0:25am
next-safe-action-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 8, 2024 0:25am

@TheEdoRan TheEdoRan merged commit 3d32f9d into main Sep 8, 2024
7 checks passed
@TheEdoRan TheEdoRan deleted the beta branch September 8, 2024 01:04
Copy link

github-actions bot commented Sep 8, 2024

🎉 This PR is included in version 7.9.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant