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
  • Parameters
  • Typescript Type
  • Usage
  1. API Reference

EventDefinition

A function that you provide to Redux Beacon for each Redux or ngrx/store action you want to track.

Syntax

function eventDef(action, prevState, nextState) {
  // Return:
  //   - an event object, or
  //   - an array of event objects, or
  //   - a Promise that resolves to an event object, or
  //   - a Promise that resolves to an array of event objects
}

Parameters

  • Redux Beacon calls every event definition with three arguments:

    • action: The action object.

    • prevState: The state before the action.

    • nextState: The state after the action.

Typescript Type

import { EventDefinition } from 'redux-beacon';

Usage

PreviouscreateMetaReducerNextEventsMap

Last updated 7 years ago

Getting Started
Examples & Recipes