Redux Beacon
  • Introduction
  • Getting Started (Redux)
  • Getting Started (ngrx)
  • Examples & Recipes
  • Targets
    • GoogleAnalytics
    • GoogleAnalyticsGtag
    • GoogleTagManager
    • Segment
    • Amplitude
    • React Native: GoogleAnalytics
    • React Native: GoogleTagManager
    • React Native: Segment
  • API Reference
    • createMiddleware
    • createMetaReducer
    • EventDefinition
    • EventsMap
    • EventsMapper
  • Extensions
    • logger
    • OfflineWeb
    • OfflineReactNative
  • Utils
    • debounceEvent
    • ensure
    • combineEvents
  • FAQ
  • Migration Guide (v1 to v2)
  • Notes on Offline Events
Powered by GitBook
On this page
  • Syntax
  • Rules
  • Typescript Type
  • Usage
  1. API Reference

EventsMapper

PreviousEventsMapNextExtensions

Last updated 7 years ago

A Function you provide to Redux Beacon to map actions to .

Syntax

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

Typescript Type

import { EventsMapper } from 'redux-beacon';

Usage

.

eventDefinitions
eventDefinition
Getting Started
Examples & Recipes