Is there a way to create an interface for a module that any host application can be expected to implement?
We've got a couple apps that have a lot of code that is common that we'd like to refactor into modules, but sometimes the module may need to call runEvent
or setNextEvent
for a handler method that lives in the host application due to unique behavior and implementation.
Can I specify in the module a contract like "host application must implement the following handlers: 'admin.foo', 'admin.bar', ..."?
I am guessing there's a module load intercept I could do this in manually, but I'm wondering if there's a convention so I can just drop the list in somewhere rather than copy-pasting boilerplate code into every module.