> For the complete documentation index, see [llms.txt](https://rangle.gitbook.io/redux-beacon/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://rangle.gitbook.io/redux-beacon/index-1/events-mapper.md).

# EventsMapper

A `Function` you provide to Redux Beacon to map actions to [eventDefinitions](/redux-beacon/index-1/event-definition.md).

## Syntax

```javascript
import {
  eventForActionA,
  eventForActionB,
  eventForActionB2,
} from './event-definitions';

const eventsMapper = (action) => {
  switch(action.type) {
    case 'ACTION_A':
      return eventForActionA;
    case 'ACTION_B':
      return [eventForActionB, eventForActionB2];
    default:
      return [];
  };
}
```

## Rules

* Each element in the returned array must be a valid

  [eventDefinition](/redux-beacon/index-1/event-definition.md).

## Typescript Type

```typescript
import { EventsMapper } from 'redux-beacon';
```

## Usage

* [Getting Started](/redux-beacon/getting-started-redux-users.md)
* [Examples & Recipes](https://github.com/rangle/redux-beacon/tree/72b71c1db33444fbbb79923546db127a2a090b75/docs/recipes/index.md)
