combineEvents
Combine multiple event defintions into one. Use this if you want to dispatch multiple analytics events for a single action.

Import

1
import combineEvents from '@redux-beacon/combine-events';
Copied!

Syntax

1
combineEvents(eventDef1 [, eventDef2, ..., eventDef3])
Copied!

Parameters

    eventDef1 ... eventDefN: EventDefinition
      The events you want to combine together.

Example

1
import combineEvents from '@redux-beacon/combine-events';
2
import { trackTiming, trackEvent } from '@redux-beacon/google-analytics';
3
import { VIDEO_PLAYING_ACTION } from './my/redux/actions';
4
5
const videoPlayed = trackEvent(() => ({
6
category: 'Videos',
7
action: 'play',
8
label: 'Fall Campaign'
9
}));
10
11
const videoLoaded = trackTiming(() => ({
12
category: 'Videos',
13
var: 'load',
14
value: 3549,
15
}));
16
17
const eventsMap = {
18
videoPlayed,
19
videoLoaded,
20
),
21
};
Copied!