johnameyer / cards-ts

A card game framework and various games in Typescript. The framework allows for bot development and playing card games in the terminal or in a browser.
MIT License
7 stars 2 forks source link

Separate handler data from messages #112

Closed johnameyer closed 4 months ago

johnameyer commented 10 months ago

Today, we encapsulate handler data inside of each and every message type which is quite repetitive across the structs as well as the relevant handlers and validators.

Ideally the data would be brought out to a new struct encapsulating the message

Ideally as a part of making this change we could clean up how the handlers process this data - namely allowing them to have strict typing through generics