> For the complete documentation index, see [llms.txt](https://trixtateam.gitbook.io/trixta-js-core/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trixtateam.gitbook.io/trixta-js-core/reference/saga-methods/respondtotrixtareactioneffectsaga.md).

# respondToTrixtaReactionEffectSaga

Will listen for a Trixta reaction for the given roleName and reactionName, dispatching the data to actionToDispatch or dispatchResponseTo parameters

### Option 1

```typescript
export const EXAMPLE_RESPONSE = 'app/EXAMPLE_RESPONSE';
export function functionToDispatch(payload) {
  return {
    type: EXAMPLE_RESPONSE,
    payload,
  }
}
```

```javascript
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

```javascript
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                                         |
