I have a webhook that reacts to a service and does 3-4 main things, each with its own helper functions. It’s about 300 lines long at this point and getting hard to read.
I was wondering if there are any best practices for separating out the code - In my own Node apps, usually, I’d make a module / class to contain all the helper code and then import that into the webhook logic.
I was thinking about using step exports, where in the first step, I declare all my functions and pin them to steps.trigger.event
and then re-use these functions in the later steps.
Can steps.trigger.event
store functions, or does it need to be a JSON-serializable object as well?
Making my own NPM package seems a bit heavy-handed and a bit harder to update and add new functionality to than I’d like.