hallgren / eventsourcing

Event Sourcing in Go
Mozilla Public License 2.0
188 stars 20 forks source link

Serializer Events() method #74

Closed hallgren closed 2 years ago

hallgren commented 2 years ago

Makes the event registration simpler.

From:

s.RegisterTypes(&SomeAggregate{}, func() interface{} { return &SomeData{} }, func() interface{} { return &SomeData2{} })

To:

s.Register(&SomeAggregate{}, s.Events(&SomeData{}, &SomeData2{}))

The "old" method RegisterTypes will still be present to keep backwards compatibility.