It should be possible to supply custom actions. Those would be of a new type in the action union and carry a name and a toStringified JavaScript function. Simple, but action functions would have to be pure (not closing over spec definitions).
Or, if we want to do this the fancier way, we'd register the custom function by name in the runtime, and only carry the name in the Action type. When performed, the action would be looked up in the runtime and called. This way, custom actions can close over state. The register would have to be recomputed on every state when generating actions.
Not sure about all implications, just a starting point to think about.
It should be possible to supply custom actions. Those would be of a new type in the action union and carry a name and a toStringified JavaScript function. Simple, but action functions would have to be pure (not closing over spec definitions).
Or, if we want to do this the fancier way, we'd register the custom function by name in the runtime, and only carry the name in the Action type. When performed, the action would be looked up in the runtime and called. This way, custom actions can close over state. The register would have to be recomputed on every state when generating actions.
Not sure about all implications, just a starting point to think about.