Ive tested a few of the app.on callback methods. I cant seem to find which method is called when a cm / sm is being saved and reloaded. I see in the log that it notices a sub module was changed and reloads the custom module. Are the callbacks intended to be used here or am I mistaken?
When a change is detected in the custom module's main file or one of its submodules (included via require()
), the following happens to the main module:
module.exports.unload
is called (if defined)- timeouts and intervals created by the module are cleared
- callbacks (add via
app.on
) registered by the module are removed - submodules (included via
require()
, notnativeRequire()
) are unloaded (steps 1 to 4) - the main module is evaluated and loaded again