useRespondToReactionEffect
React hook used to interact with a Trixta reaction that does not require a response for a given roleName. Will trigger the callBack when a reaction is received.
import { useRespondToReactionEffect } from '@trixtateam/trixta-js-core';
const {
hasRoleAccess,
} = useRespondToReactionEffect<TInitialData>({
roleName:"",
reactionName:"",
callBack: (payload?: TInitialData) => {},
debugMode: false,
});Options
roleName : stringRequired
Trixta role name
reactionName : stringRequired
Trixta reaction name
debugMode: booleanOptional
Defaults to false.
If set to
true, enables Trixta console debugging
callBack : (payload: TInitialData) => voidRequired
This function will fire any time a reaction is received from Trixta.
Returns
hasRoleAccess : booleanWill be
trueif theroleNamehas access for this user.
Last updated
Was this helpful?