# EventsMapper

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

## 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](https://rangle.gitbook.io/redux-beacon/index-1/event-definition).

## Typescript Type

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

## Usage

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