react-hooks icon indicating copy to clipboard operation
react-hooks copied to clipboard

Sync function support in useActionPending

Open otakustay opened this issue 4 years ago • 0 comments

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

otakustay avatar Feb 01 '21 09:02 otakustay