Initialize analytics service upon creation
This change ensures that each analytics service is initialized immediately after it is created. By calling the `initialize` method on the service, we ensure all necessary setup steps are performed. This prevents potential issues related to uninitialized service use.
This commit is contained in:
@@ -37,7 +37,10 @@ export function createAnalyticsManager<T extends string, Config extends object>(
|
||||
return;
|
||||
}
|
||||
|
||||
activeServices.set(provider as T, factory());
|
||||
const service = factory();
|
||||
activeServices.set(provider as T, service);
|
||||
|
||||
void service.initialize();
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user