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,
});
}
Redux action creator function to dispatch response to
Function(payload) => ({ type:string; payload})
Name of event to dispatch response to