source: trip-planner-front/node_modules/@angular-devkit/core/src/analytics/multi.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.2 KB
Line 
1"use strict";
2/**
3 * @license
4 * Copyright Google LLC All Rights Reserved.
5 *
6 * Use of this source code is governed by an MIT-style license that can be
7 * found in the LICENSE file at https://angular.io/license
8 */
9Object.defineProperty(exports, "__esModule", { value: true });
10exports.MultiAnalytics = void 0;
11/**
12 * Analytics implementation that reports to multiple analytics backend.
13 */
14class MultiAnalytics {
15 constructor(_backends = []) {
16 this._backends = _backends;
17 }
18 push(...backend) {
19 this._backends.push(...backend);
20 }
21 event(category, action, options) {
22 this._backends.forEach((be) => be.event(category, action, options));
23 }
24 screenview(screenName, appName, options) {
25 this._backends.forEach((be) => be.screenview(screenName, appName, options));
26 }
27 pageview(path, options) {
28 this._backends.forEach((be) => be.pageview(path, options));
29 }
30 timing(category, variable, time, options) {
31 this._backends.forEach((be) => be.timing(category, variable, time, options));
32 }
33 flush() {
34 return Promise.all(this._backends.map((x) => x.flush())).then(() => { });
35 }
36}
37exports.MultiAnalytics = MultiAnalytics;
Note: See TracBrowser for help on using the repository browser.