Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use generics for State and Trigger #34

Open
soypat opened this issue Mar 18, 2022 · 4 comments
Open

Use generics for State and Trigger #34

soypat opened this issue Mar 18, 2022 · 4 comments

Comments

@soypat
Copy link

soypat commented Mar 18, 2022

Go 1.18 official release brings Generics to the table!

@qmuntal
Copy link
Owner

qmuntal commented Mar 18, 2022

I've been playing with type parameters since the beginning, but I'm still not sure if they are a good addition to this library.

Anyway, you can try them by pointing to typeparams branch and check the diffs at #35.

If you do so, please report back with your experience!

@soypat
Copy link
Author

soypat commented May 18, 2022

I ended up coding a state machine implementation from scratch with a generic input argument. See https://github.com/soypat/go-maquina.

Wondering if maybe there's room for a related projects section in the readme to point users to this smaller state machine implementation?

@husam-e
Copy link

husam-e commented Feb 21, 2024

@qmuntal adding generic support would be quite valuable. Are you still open to contributing this to the lib? I'm exploring options for statechart libraries and type safety for states and triggers would be a meaningful benefit.

@suhlig
Copy link

suhlig commented Sep 12, 2024

I am proposing an updated version in #35 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants