hirethunk / verbs

Verbs is an event sourcing package for PHP artisans
https://verbs.thunk.dev
MIT License
412 stars 32 forks source link

Better singletons #172

Open inxilpro opened 3 weeks ago

inxilpro commented 3 weeks ago

Originally, we implemented AppliesToSingletonState as the way of marking a state as a singleton. This is an artifact of how states were originally defined in early versions of Verbs. A much more straightforward approach is to just have a SingletonState class. This allows us to avoid passing singleton: true all over the place, and is just more obvious and simple.