From f79ef71d5cac3b396808edc4dacdf654d65468c2 Mon Sep 17 00:00:00 2001 From: mo khan Date: Thu, 24 Jul 2025 13:23:32 -0600 Subject: refactor: remove non-essentials --- pkg/event/aggregator.go | 6 ------ pkg/event/typed_aggregator.go | 12 +++--------- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/pkg/event/aggregator.go b/pkg/event/aggregator.go index 738211e..302ad51 100644 --- a/pkg/event/aggregator.go +++ b/pkg/event/aggregator.go @@ -18,12 +18,6 @@ func WithDefaults() x.Option[*Aggregator] { }) } -func WithSubscriptions(subscriptions map[Event][]Subscription) x.Option[*Aggregator] { - return x.With(func(item *Aggregator) { - item.subscriptions = subscriptions - }) -} - func (a *Aggregator) Subscribe(event Event, f Subscription) { a.mu.Lock() defer a.mu.Unlock() diff --git a/pkg/event/typed_aggregator.go b/pkg/event/typed_aggregator.go index 542c172..9295e7d 100644 --- a/pkg/event/typed_aggregator.go +++ b/pkg/event/typed_aggregator.go @@ -7,17 +7,11 @@ type TypedAggregator[T any] struct { } func New[T any]() *TypedAggregator[T] { - return NewWith[T]( - x.New( - WithDefaults(), - ), - ) -} - -func NewWith[T any](aggregator *Aggregator) *TypedAggregator[T] { return x.New[*TypedAggregator[T]]( WithAggregator[T]( - aggregator, + x.New( + WithDefaults(), + ), ), ) } -- cgit v1.2.3