diff options
| author | mo khan <mo@mokhan.ca> | 2025-07-24 13:23:32 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-07-24 13:23:32 -0600 |
| commit | f79ef71d5cac3b396808edc4dacdf654d65468c2 (patch) | |
| tree | 245f59102b19f6c43a14ebe3537902921d549545 | |
| parent | 6a1d0871d10697ef1f8627ef39b9b44c9ba83114 (diff) | |
refactor: remove non-essentials
| -rw-r--r-- | pkg/event/aggregator.go | 6 | ||||
| -rw-r--r-- | 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(), + ), ), ) } |
