Ghost/ghost/member-analytics-service/index.js
Fabien O'Carroll ed6d305fb2 Renamed components of member-analytic-service
no-issue

This removes the concept of "Module" which simplifies the code
2021-09-21 13:33:38 +02:00

20 lines
607 B
JavaScript

const AnalyticEventRepository = require('./lib/AnalyticEventRepository');
const EventHandler = require('./lib/EventHandler');
class MemberAnalyticsService {
/**
* @param {AnalyticEventRepository} analyticEventRepository
*/
constructor(analyticEventRepository) {
this.eventHandler = new EventHandler(analyticEventRepository);
}
static create(AnalyticEventModel) {
const analyticEventRepository = new AnalyticEventRepository(AnalyticEventModel);
return new MemberAnalyticsService(analyticEventRepository);
}
}
module.exports = MemberAnalyticsService;