summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkg/event/aggregator.go6
-rw-r--r--pkg/event/typed_aggregator.go12
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(),
+ ),
),
)
}