I didn't know about the statem limitation, I have howerver worked around it with gen server like wrapper, that way all state transitions were handled with gleams type system.
I have been meaning to ask about that on the discord but its one of the ten thousand things on my backlog.
Maybe i could write a gen_event equivalent.. I have some code which does very similar things.