Refactors event system to use CoreEvents
Migrates the application to use a new CoreEvents system. This change removes the legacy EventTypes constant file and updates all managers, renderers, and core components to use the CoreEvents constant file for event emission and subscription. This improves code maintainability and promotes a consistent eventing strategy across the application. Adds validation to EventBus emit and extractCategory functions.
This commit is contained in:
parent
414ef1caaf
commit
4b4dbdc0d6
11 changed files with 76 additions and 228 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { EventBus } from '../core/EventBus';
|
||||
import { IEventBus, CalendarEvent, ResourceCalendarData } from '../types/CalendarTypes';
|
||||
import { EventTypes } from '../constants/EventTypes';
|
||||
import { CoreEvents } from '../constants/CoreEvents';
|
||||
import { calendarConfig } from '../core/CalendarConfig';
|
||||
|
||||
/**
|
||||
|
|
@ -21,7 +21,7 @@ export class EventManager {
|
|||
private setupEventListeners(): void {
|
||||
// NOTE: Removed POC event listener to prevent interference with production code
|
||||
// POC sliding animation should not trigger separate event rendering
|
||||
// this.eventBus.on(EventTypes.WEEK_CONTENT_RENDERED, ...);
|
||||
// this.eventBus.on(CoreEvents.WEEK_CONTENT_RENDERED, ...);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -140,7 +140,7 @@ export class EventManager {
|
|||
this.events.push(newEvent);
|
||||
this.syncEvents();
|
||||
|
||||
this.eventBus.emit(EventTypes.EVENT_CREATED, {
|
||||
this.eventBus.emit(CoreEvents.EVENT_CREATED, {
|
||||
event: newEvent
|
||||
});
|
||||
|
||||
|
|
@ -156,7 +156,7 @@ export class EventManager {
|
|||
|
||||
this.syncEvents();
|
||||
|
||||
this.eventBus.emit(EventTypes.EVENT_UPDATED, {
|
||||
this.eventBus.emit(CoreEvents.EVENT_UPDATED, {
|
||||
event: updatedEvent
|
||||
});
|
||||
|
||||
|
|
@ -172,7 +172,7 @@ export class EventManager {
|
|||
|
||||
this.syncEvents();
|
||||
|
||||
this.eventBus.emit(EventTypes.EVENT_DELETED, {
|
||||
this.eventBus.emit(CoreEvents.EVENT_DELETED, {
|
||||
event: deletedEvent
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue