useTrixtaAction
React hook used to interact with a Trixta action for a given roleName.
import { useTrixtaAction } from '@trixtateam/trixta-js-core';
const {
hasRoleAccess,
isInProgress,
hasResponse,
loading,
latestInstance,
response,
submitTrixtaAction,
clearActionResponses,
} = useTrixtaAction<TSuccessType,TErrorType>({ roleName:"",
actionName:"",
actionParameters:{
data:{},
extraData:{},
timeout:1500,
timeoutEvent:"",
loadingStatusRef:"",
requestEvent:"",
responseEvent:"",
errorEvent:""
},
loadingStatusRef:"",
options: {
debugMode: false,
autoSubmit: false,
setTimeoutEventAsErrorEvent: false,
clearResponsesOnCallback: false,
},
onSuccess:(success)=>{},
onError:(errror)=>{}
});Options
Returns
Last updated
Was this helpful?