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

Sync function support in useActionPending #74

Open
otakustay opened this issue Feb 1, 2021 · 0 comments
Open

Sync function support in useActionPending #74

otakustay opened this issue Feb 1, 2021 · 0 comments

Comments

@otakustay
Copy link
Member

otakustay commented Feb 1, 2021

useActionPending actually supports sync function inside its implement except the pendingCount state can be incremented and decremented without any meaningful case, the unexpected change of pendingCount can cause a performance dropdown sometimes.

In case developers are not aware of the function's async or not, it is better for useActionPending to be compatible with both, reducing unexpected change of pendingCount state by examining function's return value.

@ice-zjchen

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

No branches or pull requests

1 participant