I'm developing a plugin containing multiple custom nodes (with all nodes contained in a single HTML file). At the moment, there is quite a lot of code duplication between the various nodes, for example in their oneditprepare handlers.
For now, the only way I've been able to make this work is to have something like the following in one of the script blocks for one of the nodes:
This allows me to call this function from the various handlers using
RED.myTestFunction(), but I doubt whether this is a good approach. Are there any better approaches?