NotificationAdapter

Main notification adapter that manages both backtest and live notification storage.

Features:

  • Subscribes to signal emitters for automatic notification updates
  • Provides unified access to both backtest and live notifications
  • Singleshot enable pattern prevents duplicate subscriptions
  • Cleanup function for proper unsubscription
constructor();
enable: (() => () => void) & ISingleshotClearable

Enables notification storage by subscribing to signal emitters. Uses singleshot to ensure one-time subscription.

disable: () => void

Disables notification storage by unsubscribing from all emitters. Safe to call multiple times.

getData: (isBacktest: boolean) => Promise<NotificationModel[]>

Gets all backtest/live notifications from storage.

clear: (isBacktest: boolean) => Promise<void>

Clears all backtest/live notifications from storage.