useTrixtaActionReaction
React hook used to interact with a Trixta action and reaction for a given roleName. This hook uses a combination of both the useTrixtaAction and useTrixtaReaction hooks.
import { useTrixtaActionReaction } from '@trixtateam/trixta-js-core';
const {
hasRoleAccess,
initialData,
isInProgress,
hasResponse,
hasActionResponse,
hasReactionResponse,
loading,
actionResponse,
reactionResponse,
submitTrixtaActionResponse,
submitTrixtaReactionResponse,
clearActionResponses,
clearReactionResponses,
} = useTrixtaActionReaction<TInitialData,
TActionResponseType,
TActionErrorType,
TReactionResponseType,
TReactionErrorType
>({
actionProps:{
roleName:"",
actionName:"",
},
reactionProps:{
roleName:"",
reactionName:"",
},
autoSubmit:false,
actionParameters:{
data:{},
extraData:{},
timeout:1500,
timeoutEvent:"",
loadingStatusRef:"",
requestEvent:"",
responseEvent:"",
errorEvent:""
}
});Options
Returns
Last updated
Was this helpful?