Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
All types mentioned in the docs can be found here.
trixta-js-core is a javascript library to help any organization, easily connect to a Trixta space, build front-end components for you application. It leverages to communicate with Trixta and gives you a variety of tools / utilities to build react components.
Welcome to trixta-js-core! Here you'll find all the documentation you need to get up and running with the trixta-js-core
Dive a little deeper and start exploring our API reference to get an idea of everything that's possible with the package:
See related to Trixta Reactions
See regarding a Trixta Reaction
This example will quickly connect your react application to a Trixta space
Read up on
If your not planning to use any other sagas, you can simple use the one from trixta-js-core
If you plan on using your own sagas, then you should create a root saga and include the one from trixta-js-core
Using a saga
See that are not related to or
Trixta reaction related methods can be found here.
Read up on
Using the hook
This method will attempt to respond to a Trixta Reaction for the given roleName and reactionName
Please note your reaction must be a request for response to use this method.
roleName
Trixta role name
string
reactionName
Trixta reaction name
string
ref
Unique Trixta reaction reference. Can be found on a
string
responseEvent
Redux event for data to dispatch response to
string?
requestEvent
Redux event for data to dispatch to before submitting request to Trixta
string?
timeoutEvent
Redux event for data to dispatch error response due to timeout
string?
errorEvent
Redux event for data to dispatch error response to
string?
loadingStatusRef
Optional value to change the default isInProgress behaviour for when submitting reactions.
If you plan to use the same reaction name for the same role, on the same screen, this is when you would make use of this * property
string?
timeout
timeout in milliseconds for submitting data to Trixta, default is 15000
number?
extraData
Extra data to pass on and receive in response with the key extraData. This can be used as needed.
any
This method will attempt to send a request to the given roleName and actionName
roleName
Trixta role name
string
actionName
Trixta action name
string
actionOptions
Options for action in Trixta flow
any
debugOptions
Trixta flow debugging options
debugMode
Enables debugging for action in Trixta flow. False by default
boolean?
responseEvent
Redux event for data to dispatch response to
string?
requestEvent
Redux event for data to dispatch to before submitting request to Trixta
string?
timeoutEvent
Redux event for data to dispatch error response due to timeout
string?
errorEvent
Redux event for data to dispatch error response to
string?
loadingStatusRef
Optional value to change the default isInProgress behaviour for when submitting actions.
If you plan to use the same action name for the same role, on the same screen, this is when you would make use of this * property
string?
timeout
timeout in milliseconds for submitting data to Trixta, default is 15000
number?
extraData
Extra data to pass on and receive in response with the key extraData. This can be used as needed.
any
clearResponse
Determines if the instances for action should be cleared before submitting. False by default
boolean?
formData
Data to submit to Trixta
any
Trixta action related methods can be found here.
Here you will find all saga helper methods.
name
Trixta role name
string
name
Trixta role name
string
logPresence
determines if phoenix channel presence for role should be logged
boolean
additionalData
Any additional data to pass on joining a role
any
roles
Array of Trixta roles to join
Array<TrixtaRoleParameter>
This helper method will return the react redux dispatch event for a given roleName and reactionName. This can be used to listen for reactions in saga using the takeEvery effect
Will listen for a Trixta reaction for the given roleName and reactionName, dispatching the data to actionToDispatch or dispatchResponseTo parameters
Trixta reaction related components can be found here.
Here you can find information on all the react components.
Trixta action related components can be found here.
React component used to pass Trixta Reaction Props to your child component or function.
Please note if your reaction is a request for response, the property requestForEffect must be false
React component used to respond to the latest Trixta reaction effect or response when shouldRespond is true, by dispatching the response / initialData to actionToDispatch or dispatchResponseTo props.
Please note if your reaction is a request for response, the property requestForEffect must be false
React component used to pass Trixta Reaction Response Props to your child component or function.
Please note a reaction response is only viable, if the requestForEffect
property is false
React component used to pass Trixta Action Props to your child component or function.
React component used to only render a child component or function, if you have access to the passed roleName.
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.
roleName : string
Required
Trixta role name
reactionName : string
Required
Trixta reaction name
debugMode: boolean
Optional
Defaults to false.
If set to true
, enables Trixta console debugging
callBack : (payload: TInitialData) => void
Required
This function will fire any time a reaction is received from Trixta.
hasRoleAccess : boolean
Will be true
if the roleName
has access for this user.
React hook used to interact with a Trixta reaction for a given roleName.
roleName : string
Required
Trixta role name
reactionName : string
Required
Trixta reaction name
requestForEffect: boolean
Optional
Defaults to false.
If set to true
, this Trixta reaction is not waiting for a response and the only expect to use the initialData
loadingStatusRef: string
Optional
Optional value to change the default isInProgress behaviour for when submitting reactions. If you plan to use the same reaction name for the same role, on the same screen, this is when you would make use of this * property
debugMode: boolean
Optional
Defaults to false.
If set to true
, enables Trixta console debugging
setTimeoutEventAsErrorEvent: boolean
Optional
Defaults to false.
If set to true
, will set the timeoutEvent
to be the same as the errorEvent
clearResponsesOnCallback: boolean
Optional
Defaults to false.
If set to true
, will clear all responses when onSuccess
or onError
callbacks are called returning a value true
onSuccess : (success: TSuccessType) => void|boolean
Optional
This function will fire any time a successful response is received from Trixta.
If you return true
and clearResponsesOnCallback is true
, all responses will be cleared.
onError : (error: TErrorType) => void|boolean
Optional
This function will fire any time an error response is received from Trixta.
If you return true
and clearResponsesOnCallback is true
, all responses will be cleared.
hasRoleAccess : boolean
Will be true
if the roleName
has access for this user.
isInProgress : boolean
Will be true
if there is no response yet after calling submitTrixtaReactionResponse
or submitTrixtaReaction
.
Will be false
if there is a response after calling submitTrixtaReactionResponse
or submitTrixtaReaction
hasResponse : boolean
Will be true
if there is at least one Trixta Instance response.
loading : boolean
Will be true
if the reaction is waiting to be loaded or receive a reaction.
latestResponse :
TrixtaReactionInstanceResponse
First or most recent Trixta instance response
initialData : TInitialData on
TrixtaReactionInstance
Initial data returned from Trixta reaction instance
latestInstance :
TrixtaReactionInstance
First or most recent Trixta instance
submitTrixtaReaction : (parameters:
SubmitTrixtaFunctionParameters
) => void
This function will submit a response for the given roleName
and reactionName
clearReactionResponses : () => void
This function will clear and reset responses for the given roleName
and reactionName
.
React component used to pass Trixta Action Response Props to your child component or function.
Trixta reaction related hooks can be found here.
Here you can find information on all the react hooks.
Trixta action related hooks can be found here.
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.
actionProps: { roleName, actionName }
roleName : string
Required
Trixta role name
actionName : string
Required
Trixta action name
reactionProps: { roleName, reactionName, requestForEffect }
roleName : string?
Optional
Trixta role name
If the roleName
for actionProps
is the same, this can be excluded
reactionName : string
Required
Trixta reaction name
requestForEffect: boolean
Optional
Defaults to false.
If set to true
, this Trixta reaction is not waiting for a response and the only expect to use the initialData
autoSubmit: boolean
Optional
Defaults to false.
If set to true
, hook will submit actionParameters
to actionName
when the component mounts.
hasRoleAccess : boolean
Will be true
if the roleName
has access for this user.
isInProgress : boolean
hasActionResponse : boolean
hasReactionResponse : boolean
Initial data returned from Trixta reaction instance
hasResponse : boolean
value is based on hasReactionResponse
or hasActionResponse
.
loading : boolean
clearActionResponses : () => void
clearReactionResponses : () => void
React hook used to interact with a Trixta action for a given roleName.
roleName : string
Required
Trixta role name
actionName : string
Required
Trixta action name
loadingStatusRef: string
Optional
Optional value to change the default isInProgress behaviour for when submitting actions. If you plan to use the same action name for the same role, on the same screen, this is when you would make use of this * property
options: { debugMode, autoSubmit, setTimeoutEventAsErrorEvent, clearResponsesOnCallback }
debugMode: boolean
Optional
Defaults to false.
If set to true
, enables Trixta console debugging
autoSubmit: boolean
Optional
Defaults to false.
If set to true
, hook will submit actionParameters
to actionName
when the component mounts.
setTimeoutEventAsErrorEvent: boolean
Optional
Defaults to false.
If set to true
, will set the actionParameters
timeoutEvent
to be the same as the errorEvent
clearResponsesOnCallback: boolean
Optional
Defaults to false.
If set to true
, will clear all responses when onSuccess
or onError
callbacks are called returning a value true.
onSuccess : (success: TSuccessType) => void|boolean
Optional
This function will fire any time a successful response is received from Trixta.
If you return true
and clearResponsesOnCallback is true
, all responses will be cleared.
onError : (error: TErrorType) => void|boolean
Optional
This function will fire any time an error response is received from Trixta.
If you return true
and clearResponsesOnCallback is true
, all responses will be cleared.
hasRoleAccess : boolean
Will be true
if the roleName
has access for this user.
isInProgress : boolean
hasResponse : boolean
Will be true
if there is at least one Trixta Instance response.
loading : boolean
Will be true
if the action is waiting to be loaded.
First or most recent Trixta instance response
latestInstance : TrixtaInstance
First or most recent Trixta instance
This function will submit a request for the given roleName
and actionName
clearActionResponses : () => void
This function will clear and reset responses for the given roleName
and actionName
.
React hook used to interact with a Trixta reaction that does require a response for a given roleName. Will trigger the callBack when a reaction is received.
roleName : string
Required
Trixta role name
reactionName : string
Required
Trixta reaction name
debugMode: boolean
Optional
Defaults to false.
If set to true
, enables Trixta console debugging
hasRoleAccess : boolean
Will be true
if the roleName
has access for this user.
First or most recent Trixta instance
respondToReaction : (parameters: { data, instance, responseEvent, errorEvent }) => void
Required
This function will respond to the reaction with the data for the given parameters that is received from Trixta.
actionParameters: see related
parameters
value is based on or
value is based on hasResponse
from
value is based on hasResponse
from
initialData : TInitialData on
value is based on or .
reactionResponse :
value is based on latestResponse
from
actionResponse :
value is based response
from
submitTrixtaActionResponse : (parameters:
) => void
function is based on submitTrixtaAction
from
function is based on clearActionResponses
from
function is based on clearReactionResponses
from
submitTrixtaReactionResponse : (parameters:
) => void
function is based on submitTrixtaReaction
from
actionParameters: see related
parameters
Will be true
if there is no response yet after calling or submitTrixtaAction
.
Will be false
if there is a response after calling or submitTrixtaAction
response :
submitTrixtaAction : (parameters:
) => void
latestInstance :
A react hook that will attempt to connect to the passed Trixta space and optional params, on mount of component. This hook should be used in the entry point of your react application.
space : string
Required
Trixta space to connect to
params : Object | unknown
Optional
Any optional params when you connect to the Trixta space
This hook returns nothing
A react hook that will return authentication and authorization info.
roleName : string?
Optional
Trixta role name
isAuthenticated : boolean
Will be true
if the Trixta space connected with token parameter.
hasRole : boolean
Will be true
if the passed roleName
for the current user has access.
hasAccess : boolean
Will be true
if the hasRole
and isAuthenticated
mentioned above is true
.
isAuthorizing : boolean
Will be true
if Trixta is still authorizing the above mentioned roleName
See action related selectors
See reaction related selectors
See selectors that is not related to or
Here you can find more information on the Trixta Reducer
of Trixta state
Here you find all information related to a Trixta space.
Here you will find all information related to Trixta Roles, Actions, Reactions
?
?
?
Here you can find information all the react methods that you can dispatch.
Please note all methods need to be dispatched to the redux store either using the
useDispatch hook, the dispatch store function or the put effect in a Saga