diff options
| author | mo khan <mo@mokhan.ca> | 2025-07-24 13:01:47 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-07-24 13:01:47 -0600 |
| commit | c383121498ffb9778eb32e6ebcf89ea2925cd9c6 (patch) | |
| tree | 953502fc0446fdc110bc441b76072caff0fd1b5c | |
| parent | 586f2ba82c98cd46b339f8322e4eab0fa5594f71 (diff) | |
refactor: delegate to constructor overload
| -rw-r--r-- | pkg/event/typed_aggregator.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/pkg/event/typed_aggregator.go b/pkg/event/typed_aggregator.go index 1fecb0f..c1defb7 100644 --- a/pkg/event/typed_aggregator.go +++ b/pkg/event/typed_aggregator.go @@ -7,17 +7,19 @@ type TypedAggregator[T any] struct { } func New[T any]() *TypedAggregator[T] { - return x.New[*TypedAggregator[T]]( - WithAggregator[T]( - x.New( - WithoutSubscriptions(), - ), + return NewWith[T]( + x.New( + WithoutSubscriptions(), ), ) } func NewWith[T any](aggregator *Aggregator) *TypedAggregator[T] { - return x.New[*TypedAggregator[T]](WithAggregator[T](aggregator)) + return x.New[*TypedAggregator[T]]( + WithAggregator[T]( + aggregator, + ), + ) } func WithAggregator[T any](aggregator *Aggregator) x.Option[*TypedAggregator[T]] { |
