Refactor analytics services to support multiple providers

The analytics manager has been significantly refactored to allow the use of multiple providers simultaneously. The API has been adjusted, replacing the single active service with a new Map called activeServices, to hold the active analytics services. Additionally, several methods have been modified to return promises rather than void. The 'defaultProvider' property has been removed, as it no longer fits into the system architecture.
This commit is contained in:
gbuomprisco
2024-07-23 10:49:04 +02:00
parent 24c2ea2d27
commit b9e9b8af48
4 changed files with 58 additions and 49 deletions

View File

@@ -3,7 +3,8 @@ import { AnalyticsService } from './types';
const noop = (event: string) => {
// do nothing - this is to prevent errors when the analytics service is not initialized
return (...args: unknown[]) => {
// eslint-disable-next-line @typescript-eslint/require-await
return async (...args: unknown[]) => {
console.debug(
`Noop analytics service called with event: ${event}`,
...args.filter(Boolean),