Returns the five comment write actions, bound to the current instance.
Each writes optimistically: the change shows immediately and is rolled back
if the server rejects it, so an app can render straight from
useComments without tracking pending state itself.
Creating is the exception, and replyToComment counts as creating. A comment
that fails to post stays on screen carrying _state.createError rather than
disappearing, so passing the same commentId again retries it instead of
losing what someone typed.
The resource is resolved when an action is called rather than when the hook
runs, so one set of callbacks works across several resources. Pass resource
or resourceName per call to choose; otherwise the surrounding
ResourceProvider decides.
Returns the five comment write actions, bound to the current instance.
Each writes optimistically: the change shows immediately and is rolled back if the server rejects it, so an app can render straight from useComments without tracking pending state itself.
Creating is the exception, and
replyToCommentcounts as creating. A comment that fails to post stays on screen carrying_state.createErrorrather than disappearing, so passing the samecommentIdagain retries it instead of losing what someone typed.The resource is resolved when an action is called rather than when the hook runs, so one set of callbacks works across several resources. Pass
resourceorresourceNameper call to choose; otherwise the surroundingResourceProviderdecides.