respondToTrixtaReactionEffectSaga
Will listen for a Trixta reaction for the given roleName and reactionName, dispatching the data to actionToDispatch or dispatchResponseTo parameters
Option 1
export const EXAMPLE_RESPONSE = 'app/EXAMPLE_RESPONSE';
export function functionToDispatch(payload) {
return {
type: EXAMPLE_RESPONSE,
payload,
}
}
import { fork } from '@redux-saga/core/effects';
import { respondToTrixtaReactionEffectSaga } from '@trixtateam/trixta-js-core';
export default function* defaultSaga() {
yield fork(respondToTrixtaReactionEffectSaga, {
roleName: "",
reactionName: "",
actionToDispatch: functionToDispatch,
});
}
Option 2
import { fork } from '@redux-saga/core/effects';
import { respondToTrixtaReactionEffectSaga } from '@trixtateam/trixta-js-core';
export const EXAMPLE_RESPONSE = 'app/EXAMPLE_RESPONSE';
export default function* defaultSaga() {
yield fork(respondToTrixtaReactionEffectSaga, {
roleName: "",
reactionName: "",
dispatchResponseTo: EXAMPLE_RESPONSE,
});
}
Parameter
Description
Type
roleName
Trixta role name
string
reactionName
Trixta reaction name
string
actionToDispatch
Redux action creator function to dispatch response to
Function(payload) => ({ type:string; payload})
dispatchResponseTo
Name of event to dispatch response to
string
Last updated
Was this helpful?