I was looking around in the documentation and saw the page on events but it didn’t say anything about how to emit non-predefined events. From the source it looks like all the events are just dynamic functions, but I was hoping for something that uses a subscribe/publish/unsubscribe pattern.

Heaps do not have built-in event system like EventDispatcher in OFL as far as I’m aware. You can implement the system yourself (it’s not that hard, honestly) or use other solutions, like msignal library (it requires some fixes if you are using Haxe4). Best way would be the one that suits your case I personally use both msignal for events that may have multiple listeners and dynamic functions for one that are just callbacks.

To follow up on this, I just saw that Flixel has its own native typed event system. I may see if I can port this as a Signal thing for Heaps directly. Using an external lib for this feels like a little much, I think it should be built in.