Commit f79ef71

mo khan <mo@mokhan.ca>
2025-07-24 19:23:32
refactor: remove non-essentials
1 parent 6a1d087
Changed files (2)
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()
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(),
+			),
 		),
 	)
 }