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

Introduce builder methods for messages #122

Open johnameyer opened 4 months ago

johnameyer commented 4 months ago

Today, users have many different message classes they have to maintain with a type, payload, and readable string. We should be inspired by ngrx createAction or ts-action and take down this boilerplate.

const DealOutMessage = buildMessage('deal-out-message', props<>(), _ => ['My message']);